wasm-micro-runtime/core/iwasm
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 Fix missing intrinsics for risc-v which were reported by spec test (#1750) 2022-11-25 09:20:38 +08:00
common Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
compilation Remove unused LLVM JIT wapper functions (#1747) 2022-11-25 11:26:08 +08:00
fast-jit Fix a typo in workflow (#1760) 2022-11-30 14:00:30 +08:00
include Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
interpreter Clear some warnings and enable -Werror for NuttX (#1756) 2022-11-28 09:44:33 +08:00
libraries Fix source debugger error handling: continue executing when detached (#1725) 2022-11-28 22:12:46 +08:00
README.md Enable AoT and wamr-sdk, and change arguments of call wasm API (#157) 2020-01-21 13:26:14 +08:00