This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/core/iwasm/include
Andy 3e8927a31b
Adding option to pass user data to allocator functions (#1765)
Add an option to pass user data to the allocator functions. It is common to
do this so that the host embedder can pass a struct as user data and access
that struct from the allocator, which gives the host embedder the ability to
do things such as track allocation statistics within the allocator.

Compile with `cmake -DWASM_MEM_ALLOC_WITH_USER_DATA=1` to enable
the option, and the allocator functions provided by the host embedder should
be like below (an extra argument `data` is added):
void *malloc(void *data, uint32 size) { .. }
void *realloc(void *data, uint32 size) { .. }
void free(void *data, void *ptr) { .. }

Signed-off-by: Andrew Chambers <ncham@amazon.com>
2022-11-30 16:19:18 +08:00
..
aot_export.h Add control for the native stack check with hardware trap (#1682) 2022-11-07 18:26:33 +08:00
lib_export.h Apply clang-format for more src files and update spec test script (#775) 2021-10-08 17:47:11 +08:00
wasm_c_api.h Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
wasm_export.h Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00