mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-10 22:43:15 +00:00
Compare commits
3 Commits
9b9e938bee
...
607ae47d7b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
607ae47d7b | ||
![]() |
e8df3b5c48 | ||
![]() |
7d3bac62af |
|
@ -4010,7 +4010,7 @@ wasm_runtime_get_import_type(WASMModuleCommon *const module, int32 import_index,
|
|||
import_type->module_name = aot_import_table->module_name;
|
||||
import_type->name = aot_import_table->table_name;
|
||||
import_type->kind = WASM_IMPORT_EXPORT_KIND_TABLE;
|
||||
import_type->linked = false;
|
||||
import_type->linked = false; /* not supported */
|
||||
import_type->u.table_type =
|
||||
(WASMTableType *)&aot_import_table->table_type;
|
||||
return;
|
||||
|
@ -4023,7 +4023,7 @@ wasm_runtime_get_import_type(WASMModuleCommon *const module, int32 import_index,
|
|||
import_type->module_name = aot_import_memory->module_name;
|
||||
import_type->name = aot_import_memory->memory_name;
|
||||
import_type->kind = WASM_IMPORT_EXPORT_KIND_MEMORY;
|
||||
import_type->linked = false;
|
||||
import_type->linked = false; /* not supported */
|
||||
import_type->u.memory_type =
|
||||
(WASMMemoryType *)&aot_import_memory->mem_type;
|
||||
return;
|
||||
|
|
|
@ -712,7 +712,7 @@ wasm_runtime_get_wasi_exit_code(wasm_module_inst_t module_inst);
|
|||
* @return the function instance found, NULL if not found
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN wasm_function_inst_t
|
||||
wasm_runtime_lookup_function(wasm_module_inst_t const module_inst,
|
||||
wasm_runtime_lookup_function(const wasm_module_inst_t module_inst,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
|
@ -724,8 +724,8 @@ wasm_runtime_lookup_function(wasm_module_inst_t const module_inst,
|
|||
* @return the parameter count of the function instance
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN uint32_t
|
||||
wasm_func_get_param_count(wasm_function_inst_t const func_inst,
|
||||
wasm_module_inst_t const module_inst);
|
||||
wasm_func_get_param_count(const wasm_function_inst_t func_inst,
|
||||
const wasm_module_inst_t module_inst);
|
||||
|
||||
/**
|
||||
* Get result count of the function instance
|
||||
|
@ -736,8 +736,8 @@ wasm_func_get_param_count(wasm_function_inst_t const func_inst,
|
|||
* @return the result count of the function instance
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN uint32_t
|
||||
wasm_func_get_result_count(wasm_function_inst_t const func_inst,
|
||||
wasm_module_inst_t const module_inst);
|
||||
wasm_func_get_result_count(const wasm_function_inst_t func_inst,
|
||||
const wasm_module_inst_t module_inst);
|
||||
|
||||
/**
|
||||
* Get parameter types of the function instance
|
||||
|
@ -747,8 +747,8 @@ wasm_func_get_result_count(wasm_function_inst_t const func_inst,
|
|||
* @param param_types the parameter types returned
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN void
|
||||
wasm_func_get_param_types(wasm_function_inst_t const func_inst,
|
||||
wasm_module_inst_t const module_inst,
|
||||
wasm_func_get_param_types(const wasm_function_inst_t func_inst,
|
||||
const wasm_module_inst_t module_inst,
|
||||
wasm_valkind_t *param_types);
|
||||
|
||||
/**
|
||||
|
@ -759,8 +759,8 @@ wasm_func_get_param_types(wasm_function_inst_t const func_inst,
|
|||
* @param result_types the result types returned
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN void
|
||||
wasm_func_get_result_types(wasm_function_inst_t const func_inst,
|
||||
wasm_module_inst_t const module_inst,
|
||||
wasm_func_get_result_types(const wasm_function_inst_t func_inst,
|
||||
const wasm_module_inst_t module_inst,
|
||||
wasm_valkind_t *result_types);
|
||||
|
||||
/**
|
||||
|
@ -1314,7 +1314,7 @@ wasm_runtime_get_export_type(const wasm_module_t module, int32_t export_index,
|
|||
* @return the number of parameters for the function type
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN uint32_t
|
||||
wasm_func_type_get_param_count(wasm_func_type_t const func_type);
|
||||
wasm_func_type_get_param_count(const wasm_func_type_t func_type);
|
||||
|
||||
/**
|
||||
* Get the kind of a parameter for a function type
|
||||
|
@ -1325,7 +1325,7 @@ wasm_func_type_get_param_count(wasm_func_type_t const func_type);
|
|||
* @return the kind of the parameter if successful, -1 otherwise
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN wasm_valkind_t
|
||||
wasm_func_type_get_param_valkind(wasm_func_type_t const func_type,
|
||||
wasm_func_type_get_param_valkind(const wasm_func_type_t func_type,
|
||||
uint32_t param_index);
|
||||
|
||||
/**
|
||||
|
@ -1336,7 +1336,7 @@ wasm_func_type_get_param_valkind(wasm_func_type_t const func_type,
|
|||
* @return the number of results for the function type
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN uint32_t
|
||||
wasm_func_type_get_result_count(wasm_func_type_t const func_type);
|
||||
wasm_func_type_get_result_count(const wasm_func_type_t func_type);
|
||||
|
||||
/**
|
||||
* Get the kind of a result for a function type
|
||||
|
@ -1347,7 +1347,7 @@ wasm_func_type_get_result_count(wasm_func_type_t const func_type);
|
|||
* @return the kind of the result if successful, -1 otherwise
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN wasm_valkind_t
|
||||
wasm_func_type_get_result_valkind(wasm_func_type_t const func_type,
|
||||
wasm_func_type_get_result_valkind(const wasm_func_type_t func_type,
|
||||
uint32_t result_index);
|
||||
|
||||
/**
|
||||
|
@ -1817,7 +1817,7 @@ wasm_runtime_dump_pgo_prof_data_to_buf(wasm_module_inst_t module_inst,
|
|||
* and name string) if found, NULL otherwise
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN const uint8_t *
|
||||
wasm_runtime_get_custom_section(wasm_module_t const module_comm,
|
||||
wasm_runtime_get_custom_section(const wasm_module_t module_comm,
|
||||
const char *name, uint32_t *len);
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,9 +49,15 @@ os_dumps_proc_mem_info(char *out, unsigned int size)
|
|||
void *
|
||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||
{
|
||||
if ((uint64)size >= UINT32_MAX)
|
||||
void *addr;
|
||||
|
||||
if (size >= UINT32_MAX)
|
||||
return NULL;
|
||||
return BH_MALLOC((uint32)size);
|
||||
|
||||
if ((addr = BH_MALLOC((uint32)size)))
|
||||
memset(addr, 0, (uint32)size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -43,8 +43,10 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
|||
uintptr_t *addr_field = buf_fixed - sizeof(uintptr_t);
|
||||
*addr_field = (uintptr_t)buf_origin;
|
||||
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
|
||||
memset(buf_fixed + MEM_DUAL_BUS_OFFSET, 0, size);
|
||||
return buf_fixed + MEM_DUAL_BUS_OFFSET;
|
||||
#else
|
||||
memset(buf_fixed, 0, size);
|
||||
return buf_fixed;
|
||||
#endif
|
||||
}
|
||||
|
@ -71,6 +73,7 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
|||
uintptr_t *addr_field = buf_fixed - sizeof(uintptr_t);
|
||||
*addr_field = (uintptr_t)buf_origin;
|
||||
|
||||
memset(buf_fixed, 0, size);
|
||||
return buf_fixed;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,9 +52,15 @@ os_dumps_proc_mem_info(char *out, unsigned int size)
|
|||
void *
|
||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||
{
|
||||
if (size > ((unsigned)~0))
|
||||
void *addr;
|
||||
|
||||
if (size >= UINT32_MAX)
|
||||
return NULL;
|
||||
return BH_MALLOC((unsigned)size);
|
||||
|
||||
if ((addr = BH_MALLOC((uint32)size)))
|
||||
memset(addr, 0, (uint32)size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void *
|
||||
|
@ -88,4 +94,4 @@ os_dcache_flush(void)
|
|||
|
||||
void
|
||||
os_icache_flush(void *start, size_t len)
|
||||
{}
|
||||
{}
|
||||
|
|
|
@ -200,7 +200,12 @@ os_cond_wait(korp_cond *cond, korp_mutex *mutex)
|
|||
void *
|
||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||
{
|
||||
return rt_malloc(size);
|
||||
void *addr;
|
||||
|
||||
if ((addr = rt_malloc(size)))
|
||||
memset(addr, 0, size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -221,4 +226,4 @@ os_dcache_flush(void)
|
|||
|
||||
void
|
||||
os_icache_flush(void *start, size_t len)
|
||||
{}
|
||||
{}
|
||||
|
|
|
@ -179,12 +179,19 @@ strcspn(const char *s, const char *reject)
|
|||
void *
|
||||
os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if ((uint64)size >= UINT32_MAX)
|
||||
return NULL;
|
||||
|
||||
if (exec_mem_alloc_func)
|
||||
return exec_mem_alloc_func((uint32)size);
|
||||
addr = exec_mem_alloc_func((uint32)size);
|
||||
else
|
||||
return BH_MALLOC(size);
|
||||
addr = BH_MALLOC(size);
|
||||
|
||||
if (addr)
|
||||
memset(addr, 0, size);
|
||||
return addr;
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
Loading…
Reference in New Issue
Block a user