From 133adce4c186c95b130fb54a425183fbed30ba68 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sat, 14 Jul 2018 22:23:51 -0400 Subject: [PATCH] Enhance debug capability via GC_DEBUG_TRACE --- runtime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime.c b/runtime.c index ab062b1f..ca81d75d 100644 --- a/runtime.c +++ b/runtime.c @@ -60,8 +60,12 @@ const char *tag_names[] = { void Cyc_invalid_type_error(void *data, int tag, object found) { char buf[256]; +#if GC_DEBUG_TRACE + // Object address can be very useful for GC debugging + snprintf(buf, 255, "Invalid type: expected %s, found (%p) ", tag_names[tag], found); +#else snprintf(buf, 255, "Invalid type: expected %s, found ", tag_names[tag]); - //snprintf(buf, 255, "Invalid type: expected %s, found (%p) ", tag_names[tag], found); +#endif Cyc_rt_raise2(data, buf, found); }