Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 521927c

Browse files
authored
Documented Memory64 bound checking in Overview.md (#16)
This to reflect consensus reached in #3 See in particular #3 (comment)
1 parent 2bbd2a1 commit 521927c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

proposals/memory64/Overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ have to support 32-bit memory addresses in their ABI.
195195
⊦ mem it_1 limits_1 <= mem it_2 limits_2
196196
```
197197
198+
* Bounds checking is required to be the same as for 32-bit memories, that is,
199+
the index + offset (a `u65`) of a load or store operation is required to be
200+
checked against the current memory size and trap if out of range.
201+
202+
It is expected that the cost of this check remains low, if an implementation
203+
can implement the index check with a branch, and the offset separately using a
204+
guard page for all smaller offsets. Repeated accesses over the same index and
205+
different offsets allow simple elimination of subsequent checks.
198206
199207
### Binary format
200208

0 commit comments

Comments
 (0)