-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Validate Circular Buffer Capacity (#91)
* fix: Validate Circular Buffer Capacity * fix: cap memory in proof * refactor: Remove suspicious power of 2 number * Update exercises/practice/circular-buffer/.meta/proof.ci.wat Co-authored-by: Glenn Jackman <glenn.jackman@gmail.com> * feat: Circular Buffer can grow up to four pages * Update exercises/practice/circular-buffer/circular-buffer.wat Co-authored-by: Glenn Jackman <glenn.jackman@gmail.com> * docs: Enhance hints for Circular Buffer * docs: Update linear memory comment in proof.ci.wat for circular buffer --------- Co-authored-by: Glenn Jackman <glenn.jackman@gmail.com>
- Loading branch information
1 parent
9b783f0
commit 3a409e5
Showing
4 changed files
with
133 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# Hints | ||
|
||
Linear memory is byte-addressable, but `i32` has a width of four bytes. | ||
`i32` has a width of four bytes. | ||
|
||
"A memory instance... holds a vector of bytes. The length of the vector always is a multiple of the WebAssembly page size, which is defined to be the constant 65536" | ||
|
||
[WebAssembly Specification: Memory Instances](https://webassembly.github.io/spec/core/exec/runtime.html#page-size) | ||
|
||
"The `memory.size` instruction returns the current size of a memory. The `memory.grow` instruction grows memory by a given delta and returns the previous size, or -1 if enough memory cannot be allocated. Both instructions operate in units of page size." | ||
|
||
[WebAssembly Specification: Memory Instructions](https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-instr-memory) | ||
|
||
Further References: | ||
|
||
- [memory.size at MDN](https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Memory/Size) | ||
- [memory.grow at MDN](https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Memory/Grow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters