Open WenLY1 opened 2 weeks ago
[X] add WAMR_BUILD_SHARED_HEAP and WASM_ENABLE_SHARED_HEAP
[ ] add wamrc --enable-shared-heap
[ ] consider the behavior of import memory in multi-module feature
[ ] adapt address conversion/validation aot code boundary check wasm_runtime_invoke_native wasm_runtime_invoke_native_raw wasm_runtime_validate_app_addr wasm_runtime_addr_app_to_native wasm_runtime_addr_native_to_app wasm_runtime_validate_native_addr
[ ] interpreter/fast-jit do boundary check classic interp mode fast interp mode jit
[X] Support setting shared heap’s size and shared heap’s alloc options in RuntimeInitArgs for wasm_runtime_full_init
[ ] Add check in load module, default memory’s max_memory_size should be no larger than 4G-shared_heap_size, if not, reduce it to 4G-shared_heap_size
[X] Add API wasm_runtime_shared_malloc/wasm_runtime_shared_free
[X] App allocates memory from shared heap with API shared_malloc/shared_free example
#include <stdio.h> #include <stdlib.h> extern void *shared_malloc(int size); extern void shared_free(void *ptr); int main() { int *pa = (int *)malloc(4); *pa = 4; printf("pa value is %d\n", *pa); free(pa); int *ps = (int *)shared_malloc(4); *ps = 5; printf("ps value is %d\n", *ps); shared_free(ps); }
@WenLY1 thanks for uploading the PR, I have created branch dev/shared_heap as discussed, please submit the PR to that branch instead.
[X] add WAMR_BUILD_SHARED_HEAP and WASM_ENABLE_SHARED_HEAP
[ ] add wamrc --enable-shared-heap
[ ] consider the behavior of import memory in multi-module feature
[ ] adapt address conversion/validation aot code boundary check wasm_runtime_invoke_native wasm_runtime_invoke_native_raw
wasm_runtime_validate_app_addrwasm_runtime_addr_app_to_nativewasm_runtime_addr_native_to_appwasm_runtime_validate_native_addr[ ] interpreter/fast-jit do boundary check
classic interp modefast interp mode jit[X] Support setting shared heap’s size and shared heap’s alloc options in RuntimeInitArgs for wasm_runtime_full_init
[ ] Add check in load module, default memory’s max_memory_size should be no larger than 4G-shared_heap_size, if not, reduce it to 4G-shared_heap_size
[X] Add API wasm_runtime_shared_malloc/wasm_runtime_shared_free
[X] App allocates memory from shared heap with API shared_malloc/shared_free example