From: Ivan Maidanski Date: Thu, 21 Nov 2013 22:37:37 +0000 (+0400) Subject: Allow to force GC_dump_regularly set on at compilation X-Git-Tag: gc7_6_0~314 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=362db840b4f9409eae0b53aff9cc3a048ea722bd;p=gc Allow to force GC_dump_regularly set on at compilation * doc/README.macros (GC_DUMP_REGULARLY): Document. * misc.c (GC_dump_regularly): Turn on by default if GC_DUMP_REGULARLY macro defined (but not NO_DEBUGGING) - useful for embedded environments. * misc.c (GC_init): Skip "GC_DUMP_REGULARLY" environments variable check if GC_dump_regularly already set by the corresponding macro (only if not NO_DEBUGGING). --- diff --git a/doc/README.macros b/doc/README.macros index a822f0f4..4e93acbc 100644 --- a/doc/README.macros +++ b/doc/README.macros @@ -235,6 +235,8 @@ IGNORE_FREE Turns calls to free into a no-op. Only useful with NO_DEBUGGING Removes GC_dump and the debugging routines it calls. Reduces code size slightly at the expense of debuggability. +GC_DUMP_REGULARLY Generate regular debugging dumps. + DEBUG_THREADS Turn on printing additional thread-support debugging information. diff --git a/misc.c b/misc.c index 8e2da686..c0ba6f4d 100644 --- a/misc.c +++ b/misc.c @@ -102,8 +102,12 @@ GC_bool GC_quiet = 0; /* used also in pcr_interface.c */ #endif #ifndef NO_DEBUGGING - GC_INNER GC_bool GC_dump_regularly = FALSE; +# ifdef GC_DUMP_REGULARLY + GC_INNER GC_bool GC_dump_regularly = TRUE; /* Generate regular debugging dumps. */ +# else + GC_INNER GC_bool GC_dump_regularly = FALSE; +# endif #endif #ifdef KEEP_BACK_PTRS @@ -934,7 +938,7 @@ GC_API void GC_CALL GC_init(void) } # endif # endif /* !SMALL_CONFIG */ -# ifndef NO_DEBUGGING +# if !defined(NO_DEBUGGING) && !defined(GC_DUMP_REGULARLY) if (0 != GETENV("GC_DUMP_REGULARLY")) { GC_dump_regularly = TRUE; }