There's three parts to this: defining the size of memory (min + optional max), exporting/importing memory, and the WASM operators for getting the size of memory and growing it.
WASM might be getting multiple memories in the future, so it would make sense to treat memory as a pseudo-data type. For now at most one memory can be declared, and it must be the default memory.
Proposed declaration syntax: import? export? default? memory([min], [max]?) [identifier]
grow_memory: memory.grow([identifier:memory], [value:int])
current_memory: memory.sizeof([identifier:memory])
There's three parts to this: defining the size of memory (min + optional max), exporting/importing memory, and the WASM operators for getting the size of memory and growing it.
WASM might be getting multiple memories in the future, so it would make sense to treat memory as a pseudo-data type. For now at most one memory can be declared, and it must be the default memory.
Proposed declaration syntax:
import? export? default? memory([min], [max]?) [identifier]grow_memory:
memory.grow([identifier:memory], [value:int])current_memory:
memory.sizeof([identifier:memory])