From fd66a02930efbfeb5ec40db41327549ab3fbf521 Mon Sep 17 00:00:00 2001 From: kurt Date: Mon, 30 Apr 2012 15:33:16 +0000 Subject: [PATCH] Get GC_nprocs from sysconf _SC_NPROCESSORS_ONLN instead of hardcoding to 1. From Brad Smith tested in bulk build by naddy@ --- devel/boehm-gc/Makefile | 4 +-- .../boehm-gc/patches/patch-pthread_support_c | 29 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/devel/boehm-gc/Makefile b/devel/boehm-gc/Makefile index 38c84e1ecfb..9510e448252 100644 --- a/devel/boehm-gc/Makefile +++ b/devel/boehm-gc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.44 2012/03/24 21:21:18 kurt Exp $ +# $OpenBSD: Makefile,v 1.45 2012/04/30 15:33:16 kurt Exp $ # $FreeBSD: Makefile,v 1.4 1999/01/10 20:12:06 steve Exp $ COMMENT-main= garbage collection and memory leak detection for C and C++ @@ -8,7 +8,7 @@ VERSION= 7.0 DISTNAME= gc-${VERSION} PKGNAME-atomic= libatomic_ops-1.2 PKGNAME-main= boehm-gc-${VERSION} -REVISION = 5 +REVISION= 6 MULTI_PACKAGES= -main -atomic diff --git a/devel/boehm-gc/patches/patch-pthread_support_c b/devel/boehm-gc/patches/patch-pthread_support_c index c1f683265b2..a5cd5e467a3 100644 --- a/devel/boehm-gc/patches/patch-pthread_support_c +++ b/devel/boehm-gc/patches/patch-pthread_support_c @@ -1,17 +1,16 @@ -$OpenBSD: patch-pthread_support_c,v 1.2 2008/04/01 17:41:13 kurt Exp $ ---- pthread_support.c.orig Tue May 15 06:24:46 2007 -+++ pthread_support.c Mon Feb 11 16:35:23 2008 -@@ -774,6 +774,9 @@ void GC_thr_init(void) - # if defined(GC_NETBSD_THREADS) - GC_nprocs = get_ncpu(); +$OpenBSD: patch-pthread_support_c,v 1.3 2012/04/30 15:33:16 kurt Exp $ +--- pthread_support.c.orig Tue May 15 01:24:46 2007 ++++ pthread_support.c Tue Mar 6 10:24:21 2012 +@@ -763,7 +763,7 @@ void GC_thr_init(void) + GC_nprocs = pthread_num_processors_np(); # endif -+# if defined(GC_OPENBSD_THREADS) -+ GC_nprocs = 1; -+# endif - # if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) - int ncpus = 1; - size_t len = sizeof(ncpus); -@@ -848,7 +851,7 @@ void GC_init_parallel(void) + # if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \ +- || defined(GC_SOLARIS_THREADS) ++ || defined(GC_SOLARIS_THREADS) || defined(GC_OPENBSD_THREADS) + GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN); + if (GC_nprocs <= 0) GC_nprocs = 1; + # endif +@@ -848,7 +848,7 @@ void GC_init_parallel(void) } @@ -20,7 +19,7 @@ $OpenBSD: patch-pthread_support_c,v 1.2 2008/04/01 17:41:13 kurt Exp $ int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset) { sigset_t fudged_set; -@@ -1103,6 +1106,12 @@ void * GC_start_routine(void * arg) +@@ -1103,6 +1103,12 @@ void * GC_start_routine(void * arg) GC_enable(); # endif return GC_inner_start_routine(&sb, arg); @@ -33,7 +32,7 @@ $OpenBSD: patch-pthread_support_c,v 1.2 2008/04/01 17:41:13 kurt Exp $ # else return GC_call_with_stack_base(GC_inner_start_routine, arg); # endif -@@ -1297,7 +1306,7 @@ void GC_generic_lock(pthread_mutex_t * lock) +@@ -1297,7 +1303,7 @@ void GC_generic_lock(pthread_mutex_t * lock) /* as STL alloc.h. This isn't really the right way to do this. */ /* but until the POSIX scheduling mess gets straightened out ... */