Get rid of fiber for finalizers.
Instead, finalizers just get access to the foreign object's raw bytes. This is deliberately limiting, since it discourages the user from interacting with the VM in the middle of a GC.
This commit is contained in:
+2
-2
@@ -144,9 +144,9 @@ void fileAllocate(WrenVM* vm)
|
||||
*fd = (int)wrenGetSlotDouble(vm, 1);
|
||||
}
|
||||
|
||||
void fileFinalize(WrenVM* vm)
|
||||
void fileFinalize(void* data)
|
||||
{
|
||||
int fd = *(int*)wrenGetSlotForeign(vm, 0);
|
||||
int fd = *(int*)data;
|
||||
|
||||
// Already closed.
|
||||
if (fd == -1) return;
|
||||
|
||||
Reference in New Issue
Block a user