diff options
author | ivmai <ivmai> | 2011-05-05 05:24:48 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 21:06:58 +0400 |
commit | b898fa85675826496de2c476276ff8ca4af756bf (patch) | |
tree | 387dd91ea9c61c5076b89055dc5d63219697270e /dbg_mlc.c | |
parent | 1d242bf67846646f8abb2705a349917f158d3319 (diff) | |
download | bdwgc-b898fa85675826496de2c476276ff8ca4af756bf.tar.gz |
2011-05-05 Ivan Maidanski <ivmai@mail.ru>
* dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
comment.
* dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
* dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
* dbg_mlc.c (GC_smashed): Refine documentation.
* mark.c (GC_push_selected): Change dirty_fn return type to
GC_bool.
* os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
* reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
local variable.
* reclaim.c (GC_reclaim_block): Pass true constant to
GC_reclaim_small_nonempty_block (instead of report_if_found).
* doc/README.autoconf: Update; fix a typo.
* include/private/gcconfig.h (GC_WORD_C): New macro.
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r-- | dbg_mlc.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -25,7 +25,7 @@ GC_INNER void GC_default_print_heap_obj_proc(ptr_t p); #ifndef SHORT_DBG_HDRS - /* Check whether object with base pointer p has debugging info */ + /* Check whether object with base pointer p has debugging info. */ /* p is assumed to point to a legitimate object in our part */ /* of the heap. */ /* This excludes the check as to whether the back pointer is */ @@ -745,6 +745,14 @@ GC_API void * GC_CALL GC_debug_malloc_uncollectable(size_t lb, } #endif /* ATOMIC_UNCOLLECTABLE */ +#ifndef GC_FREED_MEM_MARKER +# if CPP_WORDSZ == 32 +# define GC_FREED_MEM_MARKER 0xdeadbeef +# else +# define GC_FREED_MEM_MARKER GC_WORD_C(0xEFBEADDEdeadbeef) +# endif +#endif + GC_API void GC_CALL GC_debug_free(void * p) { ptr_t base; @@ -787,7 +795,8 @@ GC_API void GC_CALL GC_debug_free(void * p) size_t i; size_t obj_sz = BYTES_TO_WORDS(hhdr -> hb_sz - sizeof(oh)); - for (i = 0; i < obj_sz; ++i) ((word *)p)[i] = 0xdeadbeef; + for (i = 0; i < obj_sz; ++i) + ((word *)p)[i] = GC_FREED_MEM_MARKER; GC_ASSERT((word *)p + i == (word *)(base + hhdr -> hb_sz)); } } /* !GC_find_leak */ @@ -870,10 +879,10 @@ GC_API void * GC_CALL GC_debug_realloc(void * p, size_t lb, GC_EXTRA_PARAMS) #ifndef SHORT_DBG_HDRS -/* List of smashed objects. We defer printing these, since we can't */ -/* always print them nicely with the allocation lock held. */ -/* We put them here instead of in GC_arrays, since it may be useful to */ -/* be able to look at them with the debugger. */ +/* List of smashed (clobbered) locations. We defer printing these, */ +/* since we can't always print them nicely with the allocation lock */ +/* held. We put them here instead of in GC_arrays, since it may be */ +/* useful to be able to look at them with the debugger. */ #ifndef MAX_SMASHED # define MAX_SMASHED 20 #endif |