diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-16 20:13:22 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-20 16:17:18 -0800 |
commit | d89b907d2dc260bee706f787e05f55344b61785e (patch) | |
tree | b96a139f233aca356e7dbb4fc15da484cc854baf /gc.c | |
parent | bc85ec12271ecc273cb36e7ef35d071c364e46ab (diff) | |
download | txr-d89b907d2dc260bee706f787e05f55344b61785e.tar.gz txr-d89b907d2dc260bee706f787e05f55344b61785e.tar.bz2 txr-d89b907d2dc260bee706f787e05f55344b61785e.zip |
Useful debugging function for spurious retention.
* gc.c (gc_report_copies): New function
* gc.h (gc_report_copies): Declared.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -918,3 +918,15 @@ void gc_hint_func(val *val) { (void) val; } + +void gc_report_copies(val *pvar) +{ + val *opvar = pvar; + val obj = *pvar++; + + for (; pvar < gc_stack_bottom; pvar++) { + if (*pvar == obj) + printf("%p found at %p (offset %d)\n", + (void *) obj, (void *) pvar, (int) (pvar - opvar)); + } +} |