]> granicus.if.org Git - gc/commitdiff
2007-05-21 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Mon, 21 May 2007 23:30:47 +0000 (23:30 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:40 +0000 (21:06 +0400)
* alloc.c (GC_try_to_collect): Call GC_init if necessary.
* tests/thread_leak_test.c: Don't unconditionally define
GC_LINUX_THREADS.

ChangeLog
alloc.c
tests/thread_leak_test.c

index fd8f3740d40ff14322ee07830af8c5748bba1448..0d04be4428567b00c45f611bdd87dbad27058d50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-21  Hans Boehm <Hans.Boehm@hp.com>
+
+       * 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  <a.tobler@schweiz.org>
 
        * Makefile.am: Remove extra_ldflags_libgc definition.
diff --git a/alloc.c b/alloc.c
index 7c51da9d14f49c0813f798e7a0ef29678eb49786..2fdc4587a125e9e0f1cefabe4b322eda06d24686 100644 (file)
--- 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();
index 11adb971f7a4430d8209668e7d58c9b79987170c..f2c15e967133d4e42a1c93d96ef0f2c3306978dc 100644 (file)
@@ -1,4 +1,6 @@
-#define GC_LINUX_THREADS
+#ifndef GC_THREADS
+#  define GC_THREADS
+#endif /* GC_THREADS */
 #include "leak_detector.h"
 #include <pthread.h>
 #include <stdio.h>