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
In the code examples of Reading and Writing Graphics and Reading and Writing Audio, there is a comment NOTE: Be sure to set a correct --memoryBase when when writing to memory directly like we are here. It would be nice if there is an example showing what is a correct value for the flag. I read similar issue #103 but the link to the doc doesn't really help me.
I would be happy to create a PR to further explain it after I understand the usage but I am still trying to figure it out. Your guidance on this matter would be appreciated.
The text was updated successfully, but these errors were encountered:
@hangindev Ah! Thank you very much for calling this out! 😄
So the memoryBase flag has to do with the way AssemblyScript allocates memory in the WebAssembly Linear memory. For example, here is the flag in the AssemblyScript docs:
As a general TL;DR: Let's say you needed 100 bytes of memory. You would do --memoryBase 100 if I am not mistaken. Because that means if you do something like make an array, or a string in AssemblyScript. Instead of using the first 100 bytes which you've reserved for manual memory management, the AssemblyScript runtime will use everything after that 😄
Let me know if that helps explain things! Thanks! 😄
In the code examples of Reading and Writing Graphics and Reading and Writing Audio, there is a comment
NOTE: Be sure to set a correct --memoryBase when when writing to memory directly like we are here
. It would be nice if there is an example showing what is a correct value for the flag. I read similar issue #103 but the link to the doc doesn't really help me.I would be happy to create a PR to further explain it after I understand the usage but I am still trying to figure it out. Your guidance on this matter would be appreciated.
The text was updated successfully, but these errors were encountered: