static wasm_func_t* heap_free = NULL;
static void __onyx_heap_free_wrapper(void *ptr, void* userdata) {
- if (heap_alloc == NULL) {
+ if (heap_free == NULL) {
wasm_extern_t *heap_free_extern = runtime->wasm_extern_lookup_by_name(runtime->wasm_module, runtime->wasm_instance, "stbtt_heap_free");
heap_free = runtime->wasm_extern_as_func(heap_free_extern);
}
wasm_val_vec_t results = {0,0};
wasm_val_vec_t args_arr = WASM_ARRAY_VEC(args);
- runtime->wasm_func_call(heap_alloc, &args_arr, &results);
+ runtime->wasm_func_call(heap_free, &args_arr, &results);
}
#define STBTT_malloc __onyx_heap_alloc_wrapper
stbtt_PackSetOversampling :: (ctx: ^stbtt_pack_context, h_oversample, v_oversample: i32) -> void ---
}
-#export "stbtt_heap_alloc" (size: i32) -> rawptr {
- return calloc(size);
-}
-
-#export "stbtt_heap_free" (ptr: rawptr) {
- cfree(ptr);
-}
\ No newline at end of file
+#export "stbtt_heap_alloc" calloc
+#export "stbtt_heap_free" cfree
\ No newline at end of file