feat: replace wrenAllocateForeign with wrenSetSlotNewForeign supporting arbitrary slot and class selection
The old wrenAllocateForeign was limited to slot 0 and the class at the top of the API stack. The new wrenSetSlotNewForeign takes explicit slot and classSlot parameters, allowing foreign objects to be created in any slot from any class. All internal and test call sites updated to use the new API.
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ void fileAllocate(WrenVM* vm)
|
||||
{
|
||||
// Store the file descriptor in the foreign data, so that we can get to it
|
||||
// in the finalizer.
|
||||
int* fd = (int*)wrenAllocateForeign(vm, sizeof(int));
|
||||
int* fd = (int*)wrenSetSlotNewForeign(vm, 0, 0, sizeof(int));
|
||||
*fd = (int)wrenGetSlotDouble(vm, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user