aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel/Makefile1
-rw-r--r--devel/dlmalloc/Makefile48
-rw-r--r--devel/dlmalloc/distinfo2
-rw-r--r--devel/dlmalloc/files/Makefile35
-rw-r--r--devel/dlmalloc/files/README.FreeBSD30
-rw-r--r--devel/dlmalloc/pkg-comment1
-rw-r--r--devel/dlmalloc/pkg-descr12
-rw-r--r--devel/dlmalloc/pkg-message7
-rw-r--r--devel/dlmalloc/pkg-plist8
9 files changed, 144 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 00ab9d7a7fd7..1149121d0285 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -80,6 +80,7 @@
SUBDIR += ddd
SUBDIR += dia2code
SUBDIR += diffconvert
+ SUBDIR += dlmalloc
SUBDIR += dmake
SUBDIR += dmalloc
SUBDIR += doc++
diff --git a/devel/dlmalloc/Makefile b/devel/dlmalloc/Makefile
new file mode 100644
index 000000000000..40794484060d
--- /dev/null
+++ b/devel/dlmalloc/Makefile
@@ -0,0 +1,48 @@
+# New ports collection makefile for: dlmalloc
+# Date created: 4 April 2001
+# Whom: Maxim Sobolax <sobomax@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= dlmalloc
+PORTVERSION= 2.7.0
+CATEGORIES= devel
+MASTER_SITES= ftp://gee.cs.oswego.edu/pub/misc/
+DISTFILES= malloc-${PORTVERSION}.c malloc-${PORTVERSION}.h
+EXTRACT_ONLY=
+
+MAINTAINER= sobomax@FreeBSD.org
+
+DIST_SUBDIR= ${PORTNAME}
+WRKSRC= ${WRKDIR}
+MAKEFILE= ${FILESDIR}/Makefile
+MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+ PTHREAD_LIBS="${PTHREAD_LIBS}"
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
+do-extract:
+ @${MKDIR} ${WRKDIR}
+.for file in ${DISTFILES}
+ @${CP} ${DISTDIR}/${DIST_SUBDIR}/${file} \
+ ${WRKSRC}/${file:S/-${PORTVERSION}//}
+.endfor
+
+do-install:
+ ${MKDIR} ${PREFIX}/include/${PORTNAME}
+ ${MKDIR} ${PREFIX}/share/doc/dlmalloc
+ ${INSTALL_DATA} ${WRKSRC}/malloc.h ${PREFIX}/include/${PORTNAME}
+.for suffix in "" # "_r" <- thread-safe version doesn't work yet
+ ${INSTALL_DATA} ${WRKSRC}/libdlmalloc${suffix}.a ${PREFIX}/lib
+ ${INSTALL_PROGRAM} ${WRKSRC}/dlmalloc_module${suffix}.so ${PREFIX}/lib
+.endfor
+ ${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/README.FreeBSD | \
+ /usr/bin/fmt > ${WRKDIR}/README.FreeBSD
+ ${INSTALL_MAN} ${WRKDIR}/README.FreeBSD ${PREFIX}/share/doc/dlmalloc
+ @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message | \
+ /usr/bin/fmt > ${PKGMESSAGE}
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/devel/dlmalloc/distinfo b/devel/dlmalloc/distinfo
new file mode 100644
index 000000000000..215673304d0b
--- /dev/null
+++ b/devel/dlmalloc/distinfo
@@ -0,0 +1,2 @@
+MD5 (dlmalloc/malloc-2.7.0.c) = b65e649a6c8e5c9354c7322c1b0d3608
+MD5 (dlmalloc/malloc-2.7.0.h) = 9de8397b53f5d2b485ac419e1458a33f
diff --git a/devel/dlmalloc/files/Makefile b/devel/dlmalloc/files/Makefile
new file mode 100644
index 000000000000..1272e8f76c34
--- /dev/null
+++ b/devel/dlmalloc/files/Makefile
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+SRCS= malloc.c malloc.h
+STATIC_LIB= libdlmalloc.a
+STATIC_LIB_R= libdlmalloc_r.a
+SHARED_OBJ= dlmalloc_module.so
+SHARED_OBJ_R= dlmalloc_module_r.so
+THR_SAFE_FLAG= -DUSE_MALLOC_LOCK ${PTHREAD_CFLAGS}
+CFLAGS+= -I${.CURDIR}
+
+all: ${STATIC_LIB} ${STATIC_LIB_R} ${SHARED_OBJ} ${SHARED_OBJ_R}
+
+malloc.o: ${SRCS}
+ ${CC} -c ${CFLAGS} -o ${.TARGET} malloc.c
+
+malloc_r.o: ${SRCS}
+ ${CC} -c ${CFLAGS} ${THR_SAFE_FLAG} -o ${.TARGET} malloc.c
+
+malloc.so: ${SRCS}
+ ${CC} -c ${CFLAGS} -fPIC -DPIC -o ${.TARGET} malloc.c
+
+malloc_r.so: ${SRCS}
+ ${CC} -c ${CFLAGS} ${THR_SAFE_FLAG} -fPIC -DPIC -o ${.TARGET} malloc.c
+
+${STATIC_LIB}: malloc.o
+ ${AR} cq ${.TARGET} malloc.o
+
+${STATIC_LIB_R}: malloc_r.o
+ ${AR} cq ${.TARGET} malloc_r.o
+
+${SHARED_OBJ}: malloc.so
+ ${CC} -shared -o ${.TARGET} malloc.so
+
+${SHARED_OBJ_R}: malloc_r.so
+ ${CC} -shared -o ${.TARGET} malloc_r.so ${PTHREAD_LIBS}
diff --git a/devel/dlmalloc/files/README.FreeBSD b/devel/dlmalloc/files/README.FreeBSD
new file mode 100644
index 000000000000..bdcbc097e2e6
--- /dev/null
+++ b/devel/dlmalloc/files/README.FreeBSD
@@ -0,0 +1,30 @@
+This is drop-in replacement for the standard libc malloc/realloc/free routines.
+In many cases it makes a sense to use it with your program instead of the
+standard ones, as sometimes it is significantly more efficient and fast,
+especially for the memory intensive apps such as virtual machines, GUIs etc.
+There are two methods of linking it with your program:
+
+1) Run-time linking using LD_PRELOAD.
+
+ This method doesn't requre to recompile a program, but doesn't work for
+ statically linked binaries. Just set the following environment variable and
+ run your program - dynamic linker will automatically do the rest:
+
+ LD_PRELOAD=%%PREFIX%%/lib/dlmalloc_module.so
+
+2) Compile-time linking.
+
+ Compile your applications that use the dlmalloc port with the following
+ command line options:
+
+ -I%%PREFIX%%/include/dlmalloc -L%%PREFIX%%/lib -ldlmalloc
+
+ Note that the include (-I<path>) directive shown here should appear before
+ any other include directive that would cause the compiler to find the FreeBSD
+ file malloc.h. Using the FreeBSD malloc.h instead of the dlmalloc malloc.h
+ will result in an app that fails in many odd and maybe spectacular ways.
+
+
+It makes a sense to use the first method to benchmark effect of using this
+version of memory management routines and if positive effect is confirmed then
+recompile the application using the second method.
diff --git a/devel/dlmalloc/pkg-comment b/devel/dlmalloc/pkg-comment
new file mode 100644
index 000000000000..ce821344dac2
--- /dev/null
+++ b/devel/dlmalloc/pkg-comment
@@ -0,0 +1 @@
+A very efficient malloc/free/realloc implementation
diff --git a/devel/dlmalloc/pkg-descr b/devel/dlmalloc/pkg-descr
new file mode 100644
index 000000000000..b39f07dd3906
--- /dev/null
+++ b/devel/dlmalloc/pkg-descr
@@ -0,0 +1,12 @@
+This is a version (aka dlmalloc) of malloc/free/realloc written by Doug Lea
+and released to the public domain. Use, modify, and redistribute this code
+without permission or acknowledgement in any way you wish. Send questions,
+comments, complaints, performance data, etc to dl@cs.oswego.edu
+
+This is not the fastest, most space-conserving, most portable, or most
+tunable malloc ever written. However it is among the fastest while also being
+among the most space-conserving, portable and tunable. Consistent balance
+across these factors results in a good general-purpose allocator for
+malloc-intensive programs.
+
+WWW: http://gee.cs.oswego.edu/dl/html/malloc.html
diff --git a/devel/dlmalloc/pkg-message b/devel/dlmalloc/pkg-message
new file mode 100644
index 000000000000..31ae83fecd6d
--- /dev/null
+++ b/devel/dlmalloc/pkg-message
@@ -0,0 +1,7 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Please see %%PREFIX%%/share/doc/dlmalloc/README.FreeBSD
+for instructions on how to link with dlmalloc, and for
+other issues and problems.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
diff --git a/devel/dlmalloc/pkg-plist b/devel/dlmalloc/pkg-plist
new file mode 100644
index 000000000000..6e1e80d781b3
--- /dev/null
+++ b/devel/dlmalloc/pkg-plist
@@ -0,0 +1,8 @@
+include/dlmalloc/malloc.h
+lib/dlmalloc_module.so
+@comment lib/dlmalloc_module_r.so
+lib/libdlmalloc.a
+share/doc/dlmalloc/README.FreeBSD
+@comment lib/libdlmalloc_r.a
+@dirrm share/doc/dlmalloc
+@dirrm include/dlmalloc