aboutsummaryrefslogtreecommitdiffstats
path: root/devel/ptmalloc
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2004-12-14 10:18:24 +0800
committergrog <grog@FreeBSD.org>2004-12-14 10:18:24 +0800
commitf59ee4ca8fac5267b1269264155a6851d9f4bcec (patch)
tree3bcaaf076514417bf9acedfdeca93f39e3ce48af /devel/ptmalloc
parentb5cbc0dcd66452ff2a8f0c749659bedf8ee4adf7 (diff)
downloadfreebsd-ports-gnome-f59ee4ca8fac5267b1269264155a6851d9f4bcec.tar.gz
freebsd-ports-gnome-f59ee4ca8fac5267b1269264155a6851d9f4bcec.tar.zst
freebsd-ports-gnome-f59ee4ca8fac5267b1269264155a6851d9f4bcec.zip
New port: ptmalloc is an older version of the GNU libc malloc. It has
a BSD compatible license and outperforms FreeBSD's malloc by an order of magnitude with some pathological files (notably pthreads and realloc abuse).
Diffstat (limited to 'devel/ptmalloc')
-rw-r--r--devel/ptmalloc/Makefile29
-rw-r--r--devel/ptmalloc/distinfo2
-rw-r--r--devel/ptmalloc/files/patch-Makefile55
-rw-r--r--devel/ptmalloc/pkg-descr41
-rw-r--r--devel/ptmalloc/pkg-plist3
5 files changed, 130 insertions, 0 deletions
diff --git a/devel/ptmalloc/Makefile b/devel/ptmalloc/Makefile
new file mode 100644
index 000000000000..95c946f960a1
--- /dev/null
+++ b/devel/ptmalloc/Makefile
@@ -0,0 +1,29 @@
+# Ports Collection Makefile for: ptmalloc
+# Date created: 10 December 2004
+# Who: Greg 'groggy' Lehey <grog@FreeBSD.org>
+# Whom: is grammatically incorrect in this context.
+#
+# $FreeBSD$
+
+PORTNAME= ptmalloc
+PORTVERSION= 1.0
+CATEGORIES= devel
+MASTER_SITES= http://www.malloc.de/malloc/
+DISTNAME= ptmalloc
+
+MAINTAINER= grog@FreeBSD.org
+COMMENT= Alternative malloc, performs better with threaded applications
+
+do-install: all
+ ${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so.1
+ ${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so
+ ${INSTALL_PROGRAM} ${WRKSRC}/libptmalloc.a ${PREFIX}/lib/libptmalloc.a
+
+post-install:
+ @${ECHO_CMD}
+ @${ECHO_CMD} Not much documentation is available.
+ @${ECHO_CMD} Read work/ptmalloc/README for what there is.
+ @${ECHO_CMD} See also pkg_descr
+ @${ECHO_CMD}
+
+.include <bsd.port.mk>
diff --git a/devel/ptmalloc/distinfo b/devel/ptmalloc/distinfo
new file mode 100644
index 000000000000..eb39c142ce73
--- /dev/null
+++ b/devel/ptmalloc/distinfo
@@ -0,0 +1,2 @@
+MD5 (ptmalloc.tar.gz) = 10b3fce4711eeada16726fd5e218309b
+SIZE (ptmalloc.tar.gz) = 55961
diff --git a/devel/ptmalloc/files/patch-Makefile b/devel/ptmalloc/files/patch-Makefile
new file mode 100644
index 000000000000..adb860e33228
--- /dev/null
+++ b/devel/ptmalloc/files/patch-Makefile
@@ -0,0 +1,55 @@
+--- Makefile.orig Mon Dec 20 21:58:38 1999
++++ Makefile Mon Dec 13 17:22:24 2004
+@@ -10,7 +10,7 @@
+
+ OPT_FLAGS = -O #-g
+ WARN_FLAGS = # -Wall
+-SH_FLAGS = -shared
++SH_FLAGS = -shared -fpic
+
+ # Flags for the test programs
+ T_FLAGS = -DUSE_MALLOC=1 -DMALLOC_HOOKS -DTEST=1
+@@ -27,6 +27,9 @@
+ THR_FLAGS = -DUSE_PTHREADS=1 -DUSE_TSD_DATA_HACK -D_REENTRANT
+ THR_LIBS = -lpthread
+
++# Target libraries
++LIBS= libptmalloc.a ptmalloc.so
++
+ RM = rm -f
+
+ # Don't need it for the Linux C library 6, see `glibc' target below.
+@@ -40,7 +43,7 @@
+ .c.o:
+ $(CC) -c $(CFLAGS) $<
+
+-all: $(TESTS)
++all: ${LIBS} $(TESTS)
+
+ shared: ptmalloc.so
+
+@@ -48,14 +51,14 @@
+ $(CC) -c $(CFLAGS) $(M_FLAGS) $<
+
+ ptmalloc.so: ptmalloc.c ptmalloc.h thread-m.h
+- $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) $< -o $@
++ $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) ptmalloc.c -o $@
+
+ again:
+ $(RM) $(TESTS)
+ $(MAKE) $(TESTS)
+
+ clean:
+- $(RM) ptmalloc.o ptmalloc.so $(TESTS) core
++ $(RM) ptmalloc.o ptmalloc.so $(TESTS) core lib*
+
+ t-test1$(T_SUF): t-test1.c t-test.h thread-m.h $(MALLOC)
+ $(CC) $(CFLAGS) $(T_FLAGS) t-test1.c $(MALLOC) $(THR_LIBS) -o $@
+@@ -129,3 +132,7 @@
+ dist:
+ cd ..; tar cf - $(DIST_FILES2:%=ptmalloc/%) | \
+ gzip -9 >ptmalloc.tar.gz
++
++libptmalloc.a: ptmalloc.o
++ ar qcvf $@ ptmalloc.o
++ ranlib $@
diff --git a/devel/ptmalloc/pkg-descr b/devel/ptmalloc/pkg-descr
new file mode 100644
index 000000000000..6c313803e1bd
--- /dev/null
+++ b/devel/ptmalloc/pkg-descr
@@ -0,0 +1,41 @@
+ptmalloc is the original version of the malloc that was later included
+in GNU libc. Under some circumsntaces, notably with pthreads and
+excessive calls to realloc, it performs significantly better than
+FreeBSD malloc. This version is *not* GPL or LGPL:
+
+ Copyright (c) 1999 Wolfram Gloger
+
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+ provided that (i) the above copyright notices and this permission
+ notice appear in all copies of the software and related
+ documentation, and (ii) the name of Wolfram Gloger may not be used
+ in any advertising or publicity relating to the software.
+
+ THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
+ INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
+ THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+
+This is not the latest version: it's older than the one in GNU libc.
+There is a newer version, but it's still marked as "current snapshot".
+It's in /usr/ports/devel/ptmalloc-2/.
+
+See the web site for more details: WWW: http://www.malloc.de/en/
+
+This package comes with no documentation beyond a README, which isn't
+worth installing. It appears that the GNU libc man page malloc(3)
+applies, but it's not included here for copyright reasons. There's
+nothing unusual about it. In particular, the section TUNING in
+FreeBSD malloc(3) does not apply.
+
+In addition to the library, the package contains a couple of test
+cases. Theoretically they could be run using the FreeBSD libraries,
+but they call the legacy memalign() function, which is not provided by
+FreeBSD. It may be of interest to fix this issue.
diff --git a/devel/ptmalloc/pkg-plist b/devel/ptmalloc/pkg-plist
new file mode 100644
index 000000000000..7393fab91938
--- /dev/null
+++ b/devel/ptmalloc/pkg-plist
@@ -0,0 +1,3 @@
+lib/libptmalloc.a
+lib/libptmalloc.so
+lib/libptmalloc.so.1