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
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
..
app-framework esp-idf: Make esp-idf support Libc WASI (#1356) 2022-08-15 16:17:28 +08:00
app-mgr Add darwin support for app_framework (#1601) 2022-10-16 21:23:00 +08:00
deps Integrate WASI-NN into WAMR (#1521) 2022-10-12 12:09:29 +08:00
iwasm Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
shared Fix warnings in the posix socket implementation (#1768) 2022-11-29 20:04:07 +08:00
config.h Adding option to pass user data to allocator functions (#1765) 2022-11-30 16:19:18 +08:00
version.h Maintain semantic version info in core/version.h (#1630) 2022-10-24 12:46:03 +08:00