Fix multi-module and some other issues (#1435)

Fix multi-module issue:
  don't call the sub module's function with "$sub_module_name$func_name"
Fix the aot_call_function free argv1 issue
Modify some API comments in wasm_export.h
Fix the wamrc help info
This commit is contained in:
Wenyong Huang
2022-08-31 17:38:38 +08:00
committed by GitHub
parent 47f17ef8f5
commit 22c235b5ec
5 changed files with 23 additions and 144 deletions

View File

@ -123,9 +123,9 @@ typedef union MemAllocOption {
/* Memory pool info */
typedef struct mem_alloc_info_t {
uint32_t total_size;
uint32_t total_free_size;
uint32_t highmark_size;
uint32_t total_size;
uint32_t total_free_size;
uint32_t highmark_size;
} mem_alloc_info_t;
/* WASM runtime initialize arguments */
@ -265,20 +265,18 @@ WASM_RUNTIME_API_EXTERN bool
wasm_runtime_is_xip_file(const uint8_t *buf, uint32_t size);
/**
* It is a callback for WAMR providing by embedding to load a module file
* into a buffer
* Callback to load a module file into a buffer in multi-module feature
*/
typedef bool (*module_reader)(const char *module_name,
uint8_t **p_buffer, uint32_t *p_size);
/**
* It is a callback for WAMR providing by embedding to release the buffer which
* is used by loading a module file
* Callback to release the buffer loaded by module_reader callback
*/
typedef void (*module_destroyer)(uint8_t *buffer, uint32_t size);
/**
* To setup callbacks for reading and releasing a buffer about a module file
* Setup callbacks for reading and releasing a buffer about a module file
*
* @param reader a callback to read a module file into a buffer
* @param destroyer a callback to release above buffer
@ -288,7 +286,7 @@ wasm_runtime_set_module_reader(const module_reader reader,
const module_destroyer destroyer);
/**
* Give the "module" a name "module_name".
* can not assign a new name to a module if it already has a name
* Can not assign a new name to a module if it already has a name
*
* @param module_name indicate a name
* @param module the target module
@ -302,8 +300,8 @@ wasm_runtime_register_module(const char *module_name, wasm_module_t module,
char *error_buf, uint32_t error_buf_size);
/**
* To check if there is already a loaded module named module_name in the
* runtime. you will not want to load repeately
* Check if there is already a loaded module named module_name in the
* runtime. Repeately loading a module with the same name is not allowed.
*
* @param module_name indicate a name
*
@ -1060,7 +1058,7 @@ wasm_runtime_spawn_thread(wasm_exec_env_t exec_env, wasm_thread_t *tid,
wasm_thread_callback_t callback, void *arg);
/**
* Waits a spawned thread to terminate
* Wait a spawned thread to terminate
*
* @param tid thread id
* @param retval if not NULL, output the return value of the thread