memory.grow
i32 | The number of pages to increase the memory by. |
i32 | The previous size of memory (in pages). If the value -1 is returned then the memory failed to grow. |
;; Create memory 1 page in size and can grow to 20 pages (memory 1 20) ;; Create function (func $growMemory (result i32) ;; Set the number of pages to grow by i32.const 2 ;; Grow the memory by 2 pages memory.grow ;; The stack contains an i32 value of 1 ;; previous size of memory (in pages) )