summaryrefslogtreecommitdiff
path: root/malloc.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 /malloc.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 'malloc.c')
-rw-r--r--malloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/malloc.c b/malloc.c
index 80ef18d..aeda693 100644
--- a/malloc.c
+++ b/malloc.c
@@ -354,6 +354,7 @@ void * malloc(size_t lb)
STATIC void GC_init_lib_bounds(void)
{
if (GC_libpthread_start != 0) return;
+ GC_init(); /* if not called yet */
if (!GC_text_mapping("libpthread-",
&GC_libpthread_start, &GC_libpthread_end)) {
WARN("Failed to find libpthread.so text mapping: Expect crash\n", 0);