aot_get_module_mem_consumption: Fix const strings size (#1098)

Fix the issue that the `*(uint32 *)p_const_string_size` is added repeatedly
while calculating the aot module's memory consumption.
This commit is contained in:
YAMAMOTO Takashi 2022-04-19 09:57:44 +09:00 committed by GitHub
parent 78e099b6ab
commit b4574123c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2614,7 +2614,7 @@ aot_get_aux_stack(WASMExecEnv *exec_env, uint32 *start_offset, uint32 *size)
static void
const_string_node_size_cb(void *key, void *value, void *p_const_string_size)
{
uint32 const_string_size = *(uint32 *)p_const_string_size;
uint32 const_string_size = 0;
const_string_size += bh_hash_map_get_elem_struct_size();
const_string_size += strlen((const char *)value) + 1;
*(uint32 *)p_const_string_size += const_string_size;