Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/memory/grow/index.md
6529 views
---
title: Grow slug: WebAssembly/Reference/Memory/Grow
---

{{WebAssemblySidebar}}

The grow instruction, increases the size of the memory instance by a specified number of pages, each page is sized 64KiB.

The grow instruction returns previous size of memory, in pages, if the operation was successful, and returns -1 if the operation failed.

{{EmbedInteractiveExample("pages/wat/grow.html", "tabbed-taller")}}

Syntax

;; load the number of memory pages to grow the memory by i32.const 3 ;; grow the memory by 3 pages memory.grow ;; the top item on the stack will now either be the previous number of pages (success) or `-1` (failure)
InstructionBinary opcode
memory.grow0x40