aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'clox/src/object.c')
-rw-r--r--clox/src/object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clox/src/object.c b/clox/src/object.c
index 31550ae..5f2bdde 100644
--- a/clox/src/object.c
+++ b/clox/src/object.c
@@ -13,9 +13,15 @@
static Obj *allocateObject(size_t size, ObjType type) {
Obj *object = (Obj *)reallocate(NULL, 0, size);
object->type = type;
+ object->isMarked = false;
object->next = vm.objects;
vm.objects = object;
+
+#ifdef DEBUG_LOG_GC
+ printf("%p allocate %zu for %d", (void *)object, size, type);
+#endif
+
return object;
}