Skip to content

Commit

Permalink
In GC_USE_PRECISE==1, print out some debug messages in trace_system_a…
Browse files Browse the repository at this point in the history
…reas when we find an unanchored PMC or STRING. We can use that output to help narrow down occurances.
  • Loading branch information
Whiteknight committed Sep 26, 2011
1 parent 117bd2e commit add0f24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/parrot/gc_api.h
Expand Up @@ -13,7 +13,7 @@

/* Flag to turn on precise GC
0 = no precise GC (use only stack walking)
1 = precise GC + stack walking
1 = precise GC + stack walking (for debug, also print debug messages)
2 = precise GC only (this is what we want)
*/

Expand Down
15 changes: 13 additions & 2 deletions src/gc/system.c
Expand Up @@ -485,14 +485,25 @@ trace_mem_block(PARROT_INTERP,
if ((pmc_min <= ptr)
&& (ptr < pmc_max)
&& interp->gc_sys->is_pmc_ptr(interp, (void *)ptr)) {
#if GC_USE_PRECISE == 1
fprintf(stderr, "GC_USE_PRECISE: Found PMC %x at stack location %x\n", ptr, cur_var_ptr);
#endif
Parrot_gc_mark_PMC_alive(interp, (PMC *)ptr);
}
else if ((buffer_min <= ptr) && (ptr < buffer_max)
&& interp->gc_sys->is_string_ptr(interp, (void *)ptr)) {
if (PObj_is_string_TEST((PObj *)ptr))
if (PObj_is_string_TEST((PObj *)ptr)) {
#if GC_USE_PRECISE == 1
fprintf(stderr, "GC_USE_PRECISE: Found STRING %x at stack location %x\n", ptr, cur_var_ptr);
#endif
Parrot_gc_mark_STRING_alive(interp, (STRING *)ptr);
else
}
else {
#if GC_USE_PRECISE == 1
fprintf(stderr, "GC_USE_PRECISE: Found random PObj (???) %x at stack location %x\n", ptr, cur_var_ptr);
#endif
PObj_live_SET((PObj *)ptr);
}
}
}
}
Expand Down

0 comments on commit add0f24

Please sign in to comment.