@@ -130,7 +130,7 @@ A *linear memory* is a contiguous, [byte]-addressable, readable and writable
130
130
range of memory spanning from offset ` 0 ` and extending up to a * linear-memory
131
131
size* , allocated as part of a WebAssembly instance. The size of a linear memory
132
132
is always a multiple of the [ page] size and may be increased dynamically (with
133
- the [ ` grow_memory ` ] ( #grow-memory ) instruction) up to an optional declared
133
+ the [ ` mem.grow ` ] ( #grow-memory ) instruction) up to an optional declared
134
134
* maximum length* . Linear memories are sandboxed, so they don't overlap with each
135
135
other or with other parts of a WebAssembly instance, including the call stack,
136
136
globals, and tables, and their bounds are enforced.
@@ -2823,17 +2823,17 @@ the name "wrap".
2823
2823
2824
2824
#### Grow Linear-Memory Size
2825
2825
2826
- | Mnemonic | Opcode | Immediates | Signature | Families |
2827
- | ------------- | ------ | ----------------------- | ------------------------- | -------- |
2828
- | ` grow_memory ` | 0x40 | ` $reserved ` : [ varuint1] | ` ($delta: iPTR) : (iPTR) ` | [ Z] |
2826
+ | Mnemonic | Opcode | Immediates | Signature | Families |
2827
+ | ----------- | ------ | ----------------------- | ------------------------- | -------- |
2828
+ | ` mem.grow ` | 0x40 | ` $reserved ` : [ varuint1] | ` ($delta: iPTR) : (iPTR) ` | [ Z] |
2829
2829
2830
- The ` grow_memory ` instruction increases the size of the [ default linear memory]
2831
- by ` $delta ` , in units of unsigned [ pages] . If the index of any byte of the
2830
+ The ` mem.grow ` instruction increases the size of the [ default linear memory] by
2831
+ ` $delta ` , in units of unsigned [ pages] . If the index of any byte of the
2832
2832
referenced linear memory would be unrepresentable as unsigned in an ` iPTR ` , if
2833
2833
allocation fails due to insufficient dynamic resources, or if the linear memory
2834
2834
has a ` maximum ` length and the actual size would exceed the ` maximum ` length, it
2835
2835
returns ` -1 ` and the linear-memory size is not increased; otherwise the
2836
- linear-memory size is increased, and ` grow_memory ` returns the previous
2836
+ linear-memory size is increased, and ` mem.grow ` returns the previous
2837
2837
linear-memory size, also as an unsigned value in units of [ pages] . Newly
2838
2838
allocated bytes are initialized to all zeros.
2839
2839
@@ -2851,21 +2851,25 @@ valid returns.
2851
2851
2852
2852
> ` $reserved ` is intended for future use.
2853
2853
2854
+ > This instruction was previously named ` grow_memory ` .
2855
+
2854
2856
#### Current Linear-Memory Size
2855
2857
2856
- | Mnemonic | Opcode | Immediates | Signature | Families |
2857
- | ---------------- | ------ | ----------------------- | ---------------------- | -------- |
2858
- | ` current_memory ` | 0x3f | ` $reserved ` : [ varuint1] | ` () : (iPTR) ` | [ Z] |
2858
+ | Mnemonic | Opcode | Immediates | Signature | Families |
2859
+ | ----------- | ------ | ----------------------- | ---------------------- | -------- |
2860
+ | ` mem.size ` | 0x3f | ` $reserved ` : [ varuint1] | ` () : (iPTR) ` | [ Z] |
2859
2861
2860
- The ` current_memory ` instruction returns the size of the [ default linear
2861
- memory ] , as an unsigned value in units of [ pages] .
2862
+ The ` mem.size ` instruction returns the size of the [ default linear memory ] , as
2863
+ an unsigned value in units of [ pages] .
2862
2864
2863
2865
** Validation** :
2864
2866
- [ Linear-memory size validation] ( #linear-memory-size-validation ) is required.
2865
2867
- ` $reserved ` is required to be ` 0 ` .
2866
2868
2867
2869
> ` $reserved ` is intended for future use.
2868
2870
2871
+ > This instruction was previously named ` current_memory ` .
2872
+
2869
2873
2870
2874
Instantiation
2871
2875
--------------------------------------------------------------------------------
0 commit comments