Files
wren/test/api/benchmark.c
Bob Nystrom 4b3c818ec5 Start moving embedding API towards "slot" register-API.
- wrenGetArgumentCount() -> wrenGetSlotCount()
- wrenGetArgument___() -> wrenGetSlot___()

Also, the get functions assert that the value is the right type instead
of checking at runtime. This puts the onus on the caller to be safe,
but maximizes performance.
2015-12-16 10:22:42 -08:00

23 lines
461 B
C

#include <string.h>
#include "benchmark.h"
static void arguments(WrenVM* vm)
{
double result = 0;
result += wrenGetSlotDouble(vm, 1);
result += wrenGetSlotDouble(vm, 2);
result += wrenGetSlotDouble(vm, 3);
result += wrenGetSlotDouble(vm, 4);
wrenReturnDouble(vm, result);
}
WrenForeignMethodFn benchmarkBindMethod(const char* signature)
{
if (strcmp(signature, "static Benchmark.arguments(_,_,_,_)") == 0) return arguments;
return NULL;
}