Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 415f7b2

Browse files
authoredMar 11, 2025··
Merge pull request #1195 from rune-scape/gray-fn-module
Mark a functions module as reachable for the GC
2 parents bd07122 + 9bafdda commit 415f7b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/vm/wren_value.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,9 @@ static void blackenFn(WrenVM* vm, ObjFn* fn)
10891089
// Mark the constants.
10901090
wrenGrayBuffer(vm, &fn->constants);
10911091

1092+
// Mark the module it belongs to, in case it's been unloaded.
1093+
wrenGrayObj(vm, fn->module);
1094+
10921095
// Keep track of how much memory is still in use.
10931096
vm->bytesAllocated += sizeof(ObjFn);
10941097
vm->bytesAllocated += sizeof(uint8_t) * fn->code.capacity;

0 commit comments

Comments
 (0)
Please sign in to comment.