From: hboehm Date: Mon, 21 May 2007 23:30:47 +0000 (+0000) Subject: 2007-05-21 Hans Boehm X-Git-Tag: gc7_0~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f142c201efe4ee0f39362bc039ef80c46324263;p=gc 2007-05-21 Hans Boehm * alloc.c (GC_try_to_collect): Call GC_init if necessary. * tests/thread_leak_test.c: Don't unconditionally define GC_LINUX_THREADS. --- diff --git a/ChangeLog b/ChangeLog index fd8f3740..0d04be44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-21 Hans Boehm + + * alloc.c (GC_try_to_collect): Call GC_init if necessary. + * tests/thread_leak_test.c: Don't unconditionally define + GC_LINUX_THREADS. + 2007-05-21 Andreas Tobler * Makefile.am: Remove extra_ldflags_libgc definition. diff --git a/alloc.c b/alloc.c index 7c51da9d..2fdc4587 100644 --- a/alloc.c +++ b/alloc.c @@ -729,6 +729,7 @@ int GC_try_to_collect(GC_stop_func stop_func) int result; DCL_LOCK_STATE; + if (!GC_is_initialized) GC_init(); if (GC_debugging_started) GC_print_all_smashed(); GC_INVOKE_FINALIZERS(); LOCK(); diff --git a/tests/thread_leak_test.c b/tests/thread_leak_test.c index 11adb971..f2c15e96 100644 --- a/tests/thread_leak_test.c +++ b/tests/thread_leak_test.c @@ -1,4 +1,6 @@ -#define GC_LINUX_THREADS +#ifndef GC_THREADS +# define GC_THREADS +#endif /* GC_THREADS */ #include "leak_detector.h" #include #include