Add libhoard - fast, scalable and memory-efficient

allocator for multiprocessors.

Approved by:	fjoe (mentor) (implicit)
This commit is contained in:
Sergey A. Osokin 2003-06-21 20:32:55 +00:00
parent fd41cc90a7
commit 242b05c89b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=83409
7 changed files with 167 additions and 0 deletions

View File

@ -330,6 +330,7 @@
SUBDIR += libgtop
SUBDIR += libgtop2
SUBDIR += libhash
SUBDIR += libhoard
SUBDIR += libical
SUBDIR += libmba
SUBDIR += libmcve

52
devel/libhoard/Makefile Normal file
View File

@ -0,0 +1,52 @@
# New ports collection makefile for: libhoard
# Date created: May 24, 2003
# Whom: Sergey A. Osokin <osa@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= libhoard
PORTVERSION= 2.1.2d
CATEGORIES= devel
MASTER_SITES= http://www.cs.umass.edu/~emery/software/
MAINTAINER= osa@FreeBSD.org
COMMENT= Fast, scalable and memory-efficient allocator for MP
USE_GMAKE= yes
MAKE_ENV= USE_FREEBSD=1 \
PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
INSTALLS_SHLIB= YES
.include <bsd.port.pre.mk>
TESTPROG= testos
check-os:
.if !defined(SKIP_OS_TEST)
-@${MKDIR} ${WRKSRC} ; \
${RM} -f ${WRKSRC}/${TESTPROG} ; \
${CC} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} -o ${WRKSRC}/${TESTPROG} \
${PATCHDIR}/${TESTPROG}.c > /dev/null 2>&1 ;
@if [ ! -f ${WRKSRC}/${TESTPROG} ] ; \
then \
${ECHO_MSG} "You must have a version of FreeBSD later than 4.8-STABLE" ; \
${ECHO_MSG} "27 May 2003 or 5.1-RELEASE to compile and use libhoard" ; \
exit 1 ; \
fi
@${WRKSRC}/${TESTPROG} 2>/dev/null
.endif
pre-fetch: check-os
do-install:
${INSTALL_DATA} ${WRKSRC}/libhoard.so ${PREFIX}/lib/libhoard.so.1
${LN} -sf ${PREFIX}/lib/libhoard.so.1 ${PREFIX}/lib/libhoard.so
.if !defined(NOPORTDOCS)
${INSTALL} -d -m 0755 ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/docs/asplos2000.pdf ${DOCSDIR}
.endif
.include <bsd.port.post.mk>

1
devel/libhoard/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (libhoard-2.1.2d.tar.gz) = fd0247f3ec28f507e2eb6b437263fcfe

View File

@ -0,0 +1,77 @@
--- Makefile.common.orig Mon Apr 7 19:57:11 2003
+++ Makefile.common Sun May 25 12:53:38 2003
@@ -21,8 +21,17 @@
# or supply new values as parameters to make, e.g.:
# make USE_WINDOWS=1 DEBUG=1
+ifeq ($(OSTYPE),freebsd)
+USE_FREEBSD = 1
+USE_LINUX = 0
+USE_HPUX = 0
+USE_WINDOWS = 0
+USE_SOLARIS = 0
+UNIX = 1
+endif
ifeq ($(OSTYPE),hpux)
+USE_FREEBSD = 0
USE_LINUX = 0
USE_HPUX = 1
USE_WINDOWS = 0
@@ -31,6 +40,7 @@
endif
ifeq ($(OSTYPE),linux)
+USE_FREEBSD = 0
USE_HPUX = 0
USE_LINUX = 1 # Linux
USE_WINDOWS = 0
@@ -39,6 +49,7 @@
endif
ifeq ($(OSTYPE),linux-gnu)
+USE_FREEBSD = 0
USE_HPUX = 0
USE_LINUX = 1 # Linux
USE_WINDOWS = 0
@@ -47,6 +58,7 @@
endif
ifeq ($(OSTYPE),solaris)
+USE_FREEBSD = 0
USE_HPUX = 0
USE_LINUX = 0
USE_WINDOWS = 0
@@ -55,6 +67,7 @@
endif
ifeq ($(OS),Windows_NT)
+USE_FREEBSD = 0
USE_HPUX = 0
USE_LINUX = 0
USE_WINDOWS = 1
@@ -109,6 +122,15 @@
# LIBSO = $(CC) -shared
endif
+ifeq ($(USE_FREEBSD),1)
+ GNUC = 1
+ VPATH = ../run-freebsd
+ FEATURES = ${PTHREAD_FLAGS}
+ LIBS = ${PTHREAD_LIBS}
+ UNIX = 1
+endif
+
+
ifdef BROKEN
CPATH = /usr/bin/
endif
@@ -127,7 +149,7 @@
ifdef GNUC
CC = $(CPATH)gcc
CXX = $(CPATH)g++
- FEATURES = -fPIC -D__STRICT_ANSI__ -D_GNU_SOURCE -D_REENTRANT -Wall -fno-exceptions #-fPIC
+ FEATURES = -fPIC -D__STRICT_ANSI__ -D_GNU_SOURCE -D_REENTRANT -Wall -fno-exceptions -Wno-deprecated
OPTIMIZE = -O6 -fexpensive-optimizations -finline-functions -fomit-frame-pointer -ffast-math
FEATURESXX = $(FEATURES)
OPTIMIZEXX = $(OPTIMIZE)

View File

@ -0,0 +1,16 @@
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
static int level;
level = pthread_getconcurrency();
(void)pthread_setconcurrency(level++);
printf("LIBC_R TEST PASSED: All ok\n");
exit(0);
}

15
devel/libhoard/pkg-descr Normal file
View File

@ -0,0 +1,15 @@
The Hoard memory allocator is a fast, scalable, and memory-efficient
memory allocator for shared-memory multiprocessors.
Multithreaded programs that perform dynamic memory allocation do not
scale because the heap is a bottleneck. When multiple threads
simultaneously allocate or deallocate memory from the heap, they will
be serialized while waiting for the heap lock. Programs making
intensive use of the heap actually slow down as the number of
processors increases. (Note: If you make a lot of use of the STL, you
may not know it, but you are making a lot of use of the heap.)
Hoard is a fast allocator that solves this problem. In addition, it
has very reasonable bounds on memory consumption.
WWW: http://www.hoard.org/

5
devel/libhoard/pkg-plist Normal file
View File

@ -0,0 +1,5 @@
lib/libhoard.so
lib/libhoard.so.1
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/asplos2000.pdf
%%PORTDOCS%%@dirrm %%DOCSDIR%%