constructor.
* include/gc.h (GC_init): Declare here. Add description.
* include/private/gc_priv.h (GC_init): Remove declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46420
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
/* 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
/* 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));
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)