Recognize GC_DONT_GC macro in gc.h (causes GC_INIT to turn off GC)
authorIvan Maidanski <ivmai@mail.ru>
Sat, 9 Jun 2012 18:13:53 +0000 (22:13 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 9 Jun 2012 18:13:53 +0000 (22:13 +0400)
* include/gc.h (GC_INIT_CONF_MAX_RETRIES): Recognize GC_DONT_GC
(set GC_dont_gc to 1 in that case) to turn off GC at start-up (for
a debugging purpose).

include/gc.h

index d2e13d5..f9405bb 100644 (file)
@@ -1503,7 +1503,11 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void);
 # define GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT /* empty */
 #endif
 
-#ifdef GC_MAX_RETRIES
+#ifdef GC_DONT_GC
+  /* This is for debugging only (useful if environment variables are    */
+  /* unsupported); cannot call GC_disable as goes before GC_init.       */
+# define GC_INIT_CONF_MAX_RETRIES (void)(GC_dont_gc = 1)
+#elif defined(GC_MAX_RETRIES)
   /* Set GC_max_retries to the desired value at start-up */
 # define GC_INIT_CONF_MAX_RETRIES GC_set_max_retries(GC_MAX_RETRIES)
 #else