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:
@ -234,7 +234,7 @@ is_shared_memory(WASMModule *module, uint32 mem_idx)
|
||||
|
||||
if (mem_idx < module->import_memory_count) {
|
||||
memory_import = &(module->import_memories[mem_idx].u.memory);
|
||||
is_shared = memory_import->flags & 0x02 ? true : false;
|
||||
is_shared = memory_import->mem_type.flags & 0x02 ? true : false;
|
||||
}
|
||||
else {
|
||||
memory = &module->memories[mem_idx - module->import_memory_count];
|
||||
|
||||
Reference in New Issue
Block a user