Enhance debug capability via GC_DEBUG_TRACE

This commit is contained in:
Justin Ethier 2018-07-14 22:23:51 -04:00
parent 1343490c9b
commit 133adce4c1

View file

@ -60,8 +60,12 @@ const char *tag_names[] = {
void Cyc_invalid_type_error(void *data, int tag, object found) void Cyc_invalid_type_error(void *data, int tag, object found)
{ {
char buf[256]; 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 ", tag_names[tag]);
//snprintf(buf, 255, "Invalid type: expected %s, found (%p) ", tag_names[tag], found); #endif
Cyc_rt_raise2(data, buf, found); Cyc_rt_raise2(data, buf, found);
} }