Add wasm_export.h APIs to expose memory type (#3496)

Support to get `wasm_memory_type_t memory_type` from API
`wasm_runtime_get_import_type` and `wasm_runtime_get_export_type`,
and then get shared flag, initial page cout, maximum page count
from the memory_type:
```C
bool
wasm_memory_type_get_shared(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_init_page_count(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_max_page_count(const wasm_memory_type_t memory_type);
```
This commit is contained in:
Benbuck Nason
2024-06-05 18:20:24 -07:00
committed by GitHub
parent 3fbb7fca25
commit 8239dd4aa7
18 changed files with 184 additions and 138 deletions

View File

@ -853,7 +853,7 @@ check_suspend_flags(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
LLVMBasicBlockRef terminate_block, non_terminate_block;
AOTFuncType *aot_func_type = func_ctx->aot_func->func_type;
bool is_shared_memory =
comp_ctx->comp_data->memories[0].memory_flags & 0x02 ? true : false;
comp_ctx->comp_data->memories[0].flags & 0x02 ? true : false;
/* Only need to check the suspend flags when memory is shared since
shared memory must be enabled for multi-threading */