Get GC_nprocs from sysconf _SC_NPROCESSORS_ONLN instead of

hardcoding to 1. From Brad Smith <brad@comstyle.com> tested
in bulk build by naddy@
This commit is contained in:
kurt 2012-04-30 15:33:16 +00:00
parent 05e2f18b39
commit fd66a02930
2 changed files with 16 additions and 17 deletions

View File

@ -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

View File

@ -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 ... */