summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-07-05 18:35:22 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:07:00 +0200
commitd0f043893c60075690a974e41901fb7a878cad3d (patch)
tree7176ec0869814ef4937a4b8a090745d98222d6c2 /misc.c
parentaaa06557570bc020a988353019e799b8d0d16943 (diff)
2011-07-05 Ivan Maidanski <ivmai@mail.ru>
* malloc.c (GC_init_lib_bounds): Call GC_init (to ensure GC is initialized before doing GC_text_mapping). * misc.c (GC_init): Add a check for GC_init recursion in case of malloc is redirected (abort with the corresponding message). * pthread.c (GC_thr_init): Place GC_add_roots_inner call into "else" branch to prevent "local variable might be uninitialized" compiler warning; add comment.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 34bb570..c2d5cab 100644
--- a/misc.c
+++ b/misc.c
@@ -663,6 +663,14 @@ GC_API void GC_CALL GC_init(void)
IF_CANCEL(int cancel_state;)
if (GC_is_initialized) return;
+# ifdef REDIRECT_MALLOC
+ {
+ static GC_bool init_started = FALSE;
+ if (init_started)
+ ABORT("Redirected malloc() called during GC init");
+ init_started = TRUE;
+ }
+# endif
# ifdef GC_INITIAL_HEAP_SIZE
initial_heap_sz = divHBLKSZ(GC_INITIAL_HEAP_SIZE);