Many embedded devices currently cannot afford to allocate even a single page of Linear Memory (64KB). In Wasm3 engine, we set memoryLimit to the actual amount available. This way, we allocate a fraction of a page (usually 2..16 Kb), and trap on OOB access attempts.
The AssemblyScript allocator assumes that the full page is accessible and performs OOB access during initialization, which renders it unusable in this situation.
I think it would be great to have something similar to memoryLimit flag for asc.
Another option would be to support pages <64Kb, however this is not compatible with current wasm spec. This is also discussed here here and here
Let me know what you think.
Many embedded devices currently cannot afford to allocate even a single page of Linear Memory (64KB). In
Wasm3engine, we setmemoryLimitto the actual amount available. This way, we allocate a fraction of a page (usually 2..16 Kb), and trap on OOB access attempts.The AssemblyScript allocator assumes that the full page is accessible and performs OOB access during initialization, which renders it unusable in this situation.
I think it would be great to have something similar to
memoryLimitflag forasc.Another option would be to support pages
<64Kb, however this is not compatible with current wasm spec. This is also discussed here here and hereLet me know what you think.