binaryen
binaryen copied to clipboard
[wasm-opt] Global variables are not shared between threads, so using wasm-opt `--multi-memory-lowering` will cause memory corruption.
Please ignore this comment and read on. Currently, --multi-memory-lowering seems to handle memory allocation in the Min memory. However, in practice, it would be more natural if the allocation could adapt to the Max memory size specified for the module.
However, this may become excessively large, so it would be preferable if it could be configurable.
Since this would break compatibility, it would likely require introducing a new command.
Since it's dynamic memory allocation, it seems fine. The above statement is incorrect. However, global variables are not shared across threads. This causes memory access to become corrupted. Is there any way to fix this?