summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-06 06:43:49 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:58 +0200
commit9d99463219d3125e87c7a07cf6aba5624e16aae6 (patch)
tree5202a4816a9a04ac8fa7b8ed64dbebf238b90cfa /misc.c
parentb898fa85675826496de2c476276ff8ca4af756bf (diff)
2011-05-06 Ivan Maidanski <ivmai@mail.ru>
* dbg_mlc.c (GC_has_other_debug_info): Change return type to int; return -1 if the object has (or had) debugging info but was marked deallocated. * include/private/dbg_mlc.h (GC_has_other_debug_info): Ditto. * dbg_mlc.c (GC_has_other_debug_info): Update documentation; remove "ohdr" local variable. * dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has probably been deallocated. * dbg_mlc.c (GC_debug_free): Don't actually free the object even in the leak-finding mode if GC_findleak_delay_free. * dbg_mlc.c (GC_print_all_smashed_proc): Print a trailing blank line. * dbg_mlc.c (GC_check_leaked): New function (only unless SHORT_DBG_HDRS). * doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document. * doc/README.macros (GC_FINDLEAK_DELAY_FREE): Ditto. * include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C on 64-bit architectures. * include/private/dbg_mlc.h (NOT_MARKED): Remove redundant parentheses. * include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to GC_has_other_debug_info change). * include/private/gc_priv.h (GC_findleak_delay_free): New global variable declaration (unless SHORT_DBG_HDRS). * misc.c (GC_findleak_delay_free): New global variable; recognize GC_FINDLEAK_DELAY_FREE. * misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment variable (unless SHORT_DBG_HDRS). * reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS). * reclaim.c (GC_add_leaked): Don't add the object to leaked list if marked as deallocated.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index bd8730f..50d55e0 100644
--- a/misc.c
+++ b/misc.c
@@ -114,6 +114,14 @@ GC_bool GC_quiet = 0; /* used also in pcr_interface.c */
int GC_find_leak = 0;
#endif
+#ifndef SHORT_DBG_HDRS
+# ifdef GC_FINDLEAK_DELAY_FREE
+ GC_INNER GC_bool GC_findleak_delay_free = TRUE;
+# else
+ GC_INNER GC_bool GC_findleak_delay_free = FALSE;
+# endif
+#endif /* !SHORT_DBG_HDRS */
+
#ifdef ALL_INTERIOR_POINTERS
int GC_all_interior_pointers = 1;
#else
@@ -789,6 +797,11 @@ GC_API void GC_CALL GC_init(void)
if (0 != GETENV("GC_FIND_LEAK")) {
GC_find_leak = 1;
}
+# ifndef SHORT_DBG_HDRS
+ if (0 != GETENV("GC_FINDLEAK_DELAY_FREE")) {
+ GC_findleak_delay_free = TRUE;
+ }
+# endif
if (0 != GETENV("GC_ALL_INTERIOR_POINTERS")) {
GC_all_interior_pointers = 1;
}