|
@@ -919,6 +919,26 @@ return_func:
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+bool
|
|
|
|
|
+wasm_runtime_enlarge_memory(WASMModuleInstanceCommon *module_inst,
|
|
|
|
|
+ uint32_t inc_page_count)
|
|
|
|
|
+{
|
|
|
|
|
+#if WASM_ENABLE_AOT != 0
|
|
|
|
|
+ if (module_inst->module_type == Wasm_Module_AoT) {
|
|
|
|
|
+ return aot_enlarge_memory((AOTModuleInstance *)module_inst,
|
|
|
|
|
+ inc_page_count);
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+#if WASM_ENABLE_INTERP != 0
|
|
|
|
|
+ if (module_inst->module_type == Wasm_Module_Bytecode) {
|
|
|
|
|
+ return wasm_enlarge_memory((WASMModuleInstance *)module_inst,
|
|
|
|
|
+ inc_page_count);
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void
|
|
void
|
|
|
wasm_runtime_set_enlarge_mem_error_callback(
|
|
wasm_runtime_set_enlarge_mem_error_callback(
|
|
|
const enlarge_memory_error_callback_t callback, void *user_data)
|
|
const enlarge_memory_error_callback_t callback, void *user_data)
|