more debug related refactoring

This commit is contained in:
2023-08-25 20:44:24 -05:00
committed by cpunch
parent 7c5d2f6b65
commit 2f0f675159
3 changed files with 26 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ CObj *cosmoO_allocateBase(CState *state, size_t sz, CObjType type)
obj->nextRoot = NULL;
#ifdef GC_DEBUG
printf("allocated %p with OBJ_TYPE %d\n", obj, type);
printf("allocated %s %p\n", cosmoO_typeStr(obj), obj);
#endif
return obj;
}
@@ -41,9 +41,7 @@ CObj *cosmoO_allocateBase(CState *state, size_t sz, CObjType type)
void cosmoO_free(CState *state, CObj *obj)
{
#ifdef GC_DEBUG
printf("freeing %p [", obj);
printObject(obj);
printf("]\n");
printf("freeing %s %p\n", cosmoO_typeStr(obj), obj);
#endif
switch (obj->type) {
case COBJ_STRING: {