Skip to content

Commit 376385c

Browse files
authored
Update memory allocation functions to use allocator user data (#4043)
1 parent 171d356 commit 376385c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/iwasm/common/wasm_memory.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ wasm_enlarge_memory_internal(WASMModuleInstanceCommon *module,
13671367
if (!(memory_data_new =
13681368
realloc_func(Alloc_For_LinearMemory, full_size_mmaped,
13691369
#if WASM_MEM_ALLOC_WITH_USER_DATA != 0
1370-
NULL,
1370+
allocator_user_data,
13711371
#endif
13721372
memory_data_old, total_size_new))) {
13731373
ret = false;
@@ -1680,7 +1680,7 @@ wasm_deallocate_linear_memory(WASMMemoryInstance *memory_inst)
16801680
(void)map_size;
16811681
free_func(Alloc_For_LinearMemory,
16821682
#if WASM_MEM_ALLOC_WITH_USER_DATA != 0
1683-
NULL,
1683+
allocator_user_data,
16841684
#endif
16851685
memory_inst->memory_data);
16861686
#else
@@ -1733,7 +1733,7 @@ wasm_allocate_linear_memory(uint8 **data, bool is_shared_memory,
17331733
(void)wasm_mmap_linear_memory;
17341734
if (!(*data = malloc_func(Alloc_For_LinearMemory,
17351735
#if WASM_MEM_ALLOC_WITH_USER_DATA != 0
1736-
NULL,
1736+
allocator_user_data,
17371737
#endif
17381738
*memory_data_size))) {
17391739
return BHT_ERROR;

0 commit comments

Comments
 (0)