[wasm] Simplify memory cleaning

This commit is contained in:
Behdad Esfahbod 2023-02-25 10:08:22 -07:00
parent 6746ca4ae2
commit 41362cc339
2 changed files with 3 additions and 2 deletions

View File

@ -130,7 +130,8 @@ HB_WASM_API (bool_t, buffer_copy_contents) (HB_WASM_EXEC_ENV
return true;
}
buffer_contents_free (exec_env, contentsptr);
module_free (contents->info);
module_free (contents->pos);
contents->length = length;
contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, length * sizeof (buffer->info[0]));

View File

@ -61,7 +61,7 @@ HB_WASM_API (bool_t, face_copy_table) (HB_WASM_EXEC_ENV
return true;
}
blob_free (exec_env, blobptr);
module_free (blob->data);
blob->length = length;
blob->data = wasm_runtime_module_dup_data (module_inst, hb_data, length);