From 59a834e97cb04b7e02ce3621ccbb30a71f0476ee Mon Sep 17 00:00:00 2001 From: rune-scape Date: Wed, 5 Mar 2025 19:31:38 -0800 Subject: [PATCH 1/2] Gray the module that functions belong to --- src/vm/wren_value.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vm/wren_value.c b/src/vm/wren_value.c index c49a3b6b..704eddc3 100644 --- a/src/vm/wren_value.c +++ b/src/vm/wren_value.c @@ -1089,6 +1089,9 @@ static void blackenFn(WrenVM* vm, ObjFn* fn) // Mark the constants. wrenGrayBuffer(vm, &fn->constants); + // Mark the module it belogs to, in case it's been unloaded. + wrenGrayObj(vm, fn->module); + // Keep track of how much memory is still in use. vm->bytesAllocated += sizeof(ObjFn); vm->bytesAllocated += sizeof(uint8_t) * fn->code.capacity; From 9bafddadd620888bef75ebe7eb9db889acc707e5 Mon Sep 17 00:00:00 2001 From: ruby0x1 Date: Mon, 10 Mar 2025 17:43:44 -0700 Subject: [PATCH 2/2] Update wren_value.c --- src/vm/wren_value.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm/wren_value.c b/src/vm/wren_value.c index 704eddc3..6a38193f 100644 --- a/src/vm/wren_value.c +++ b/src/vm/wren_value.c @@ -1089,7 +1089,7 @@ static void blackenFn(WrenVM* vm, ObjFn* fn) // Mark the constants. wrenGrayBuffer(vm, &fn->constants); - // Mark the module it belogs to, in case it's been unloaded. + // Mark the module it belongs to, in case it's been unloaded. wrenGrayObj(vm, fn->module); // Keep track of how much memory is still in use.