Generate wrenAllocateForeign() to match the other setSlot methods.

Thanks, Michel!
This commit is contained in:
Bob Nystrom
2016-01-24 09:25:04 -08:00
parent 71e2458a6c
commit fde6cfc142
5 changed files with 31 additions and 28 deletions
+1 -1
View File
@@ -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);
}