From 14b3866ac09c80b8f34d79227d743eabb2da0f2a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 4 Jun 2022 22:00:27 -0700 Subject: Chapter 26.1, 26.2, 26.3, and 26.4 --- clox/src/object.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clox/src/object.c') 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; } -- cgit v1.2.3-54-g00ecf