You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a custom allocator with the given configuration, callbacks.
Your environment
Host OS : Linux
WAMR version 2.2.0, Linux
Steps to reproduce
Implement custom allocator and print user data pointer.
Expected behavior
I expect 'vm' (my user data) to be visible in the custom allocator callbacks
using the user parameter.
Actual behavior
However, it is NULL when usage = Alloc_For_LinearMemory.
Extra Info
Inspecting the code (wasm_memory.c), it is set to NULL for Alloc_For_LinearMemory allocation
and 'allocator_user_data' for Alloc_For_RuntimeMemory.
Changing the NULL to 'allocator_user_data' fixed the problem.
The text was updated successfully, but these errors were encountered:
Description
UserData is always NULL for custom allocator when usage is Alloc_For_LinearMemory.
Test case
Using this configuration :
With this initialization :
With this custom allocator :
Implement a custom allocator with the given configuration, callbacks.
Your environment
Steps to reproduce
Expected behavior
I expect 'vm' (my user data) to be visible in the custom allocator callbacks
using the user parameter.
Actual behavior
However, it is NULL when usage = Alloc_For_LinearMemory.
Extra Info
Inspecting the code (wasm_memory.c), it is set to NULL for Alloc_For_LinearMemory allocation
and 'allocator_user_data' for Alloc_For_RuntimeMemory.
Changing the NULL to 'allocator_user_data' fixed the problem.
The text was updated successfully, but these errors were encountered: