wasm-micro-runtime/core/iwasm/common
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
..
arch Implement invokeNative asm code for MinGW (#1753) 2022-11-28 17:48:06 +08:00
iwasm_common.cmake Implement invokeNative asm code for MinGW (#1753) 2022-11-28 17:48:06 +08:00
SConscript Add ia32 support and fix compiling issue for RT-Thread (#730) 2021-09-07 10:20:14 +08:00
wasm_application.c Clear some warnings and enable -Werror for NuttX (#1756) 2022-11-28 09:44:33 +08:00
wasm_c_api_internal.h Add wasm_module_obtain() to clone wasm_module_t (#1660) 2022-11-09 12:50:58 +08:00
wasm_c_api.c Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
wasm_exec_env.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
wasm_exec_env.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
wasm_memory.c Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
wasm_memory.h Enlarge max pool size and fix bh_memcpy_s dest max size check (#1151) 2022-05-07 16:09:16 +08:00
wasm_native.c Clear some warnings and enable -Werror for NuttX (#1756) 2022-11-28 09:44:33 +08:00
wasm_native.h Add wasm_runtime_unregister_natives (#1647) 2022-10-28 11:03:39 +08:00
wasm_runtime_common.c Create module hash for each module in SGX lib-rats (#1745) 2022-11-24 21:48:50 +08:00
wasm_runtime_common.h Create module hash for each module in SGX lib-rats (#1745) 2022-11-24 21:48:50 +08:00
wasm_shared_memory.c Fix scenario where the timeout for atomic wait is set to negative number (#1767) 2022-11-29 18:45:07 +08:00
wasm_shared_memory.h Apply clang-format for more src files and update spec test script (#775) 2021-10-08 17:47:11 +08:00