diff options
author | Bryce McKinlay <bryce@waitaki.otago.ac.nz> | 2001-10-23 00:28:56 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2001-10-23 01:28:56 +0100 |
commit | aeb76991de5a1a2d628685c01d66871459f8fc4f (patch) | |
tree | de56600c16419b970a38e8a7932d6f2c3e30d191 | |
parent | b45bc005dc8978f353795c2886992df4a4e140f1 (diff) | |
download | gcc-aeb76991de5a1a2d628685c01d66871459f8fc4f.zip gcc-aeb76991de5a1a2d628685c01d66871459f8fc4f.tar.gz gcc-aeb76991de5a1a2d628685c01d66871459f8fc4f.tar.bz2 |
linux_threads.c (GC_init_parallel): Do not declare as a static constructor.
* linux_threads.c (GC_init_parallel): Do not declare as a static
constructor.
* include/gc.h (GC_init): Declare here. Add description.
* include/private/gc_priv.h (GC_init): Remove declaration.
From-SVN: r46420
-rw-r--r-- | boehm-gc/ChangeLog | 7 | ||||
-rw-r--r-- | boehm-gc/include/gc.h | 8 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_priv.h | 1 | ||||
-rw-r--r-- | boehm-gc/linux_threads.c | 6 |
4 files changed, 16 insertions, 6 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 58c5f39..2d67f75 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2001-10-22 Bryce McKinlay <bryce@waitaki.otago.ac.nz> + + * linux_threads.c (GC_init_parallel): Do not declare as a static + constructor. + * include/gc.h (GC_init): Declare here. Add description. + * include/private/gc_priv.h (GC_init): Remove declaration. + 2001-10-16 Loren J. Rittle <ljrittle@acm.org> * include/gc_pthread_redirects.h: Generalize test to use GC_PTHREADS. diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h index 8ac709b..c73ecc0 100644 --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -297,6 +297,14 @@ GC_API int GC_dont_precollect; /* Don't collect as part of */ /* Wizards only. */ /* Public procedures */ + +/* Initialize the collector. This is only required when using thread-local + * allocation, since unlike the regular allocation routines, GC_local_malloc + * is not self-initializing. If you use GC_local_malloc you should arrange + * to call this somehow (e.g. from a constructor) before doing any allocation. + */ +GC_API void GC_init GC_PROTO((void)); + /* * general purpose allocation routines, with roughly malloc calling conv. * The atomic versions promise that no relevant pointers are contained diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h index ad204e9..92067d2 100644 --- a/boehm-gc/include/private/gc_priv.h +++ b/boehm-gc/include/private/gc_priv.h @@ -1629,7 +1629,6 @@ GC_bool GC_collect_or_expand GC_PROTO(( \ /* blocks available. Should be called */ /* until the blocks are available or */ /* until it fails by returning FALSE. */ -GC_API void GC_init GC_PROTO((void)); /* Initialize collector. */ #if defined(MSWIN32) || defined(MSWINCE) void GC_deinit GC_PROTO((void)); diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c index ccd7dc6..b26988c 100644 --- a/boehm-gc/linux_threads.c +++ b/boehm-gc/linux_threads.c @@ -204,11 +204,7 @@ GC_thread GC_lookup_thread(pthread_t id); static GC_bool parallel_initialized = FALSE; -# if defined(__GNUC__) - void GC_init_parallel() __attribute__ ((constructor)); -# else - void GC_init_parallel(); -# endif +void GC_init_parallel(); # if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL) |