forked from Mirror/wren
Merge pull request #1195 from rune-scape/gray-fn-module
Mark a functions module as reachable for the GC
This commit is contained in:
@ -1089,6 +1089,9 @@ static void blackenFn(WrenVM* vm, ObjFn* fn)
|
||||
// Mark the constants.
|
||||
wrenGrayBuffer(vm, &fn->constants);
|
||||
|
||||
// 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.
|
||||
vm->bytesAllocated += sizeof(ObjFn);
|
||||
vm->bytesAllocated += sizeof(uint8_t) * fn->code.capacity;
|
||||
|
||||
Reference in New Issue
Block a user