-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience methods for reading from and writing to the heap (#4)
- Loading branch information
Showing
5 changed files
with
84 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
(module | ||
(import "native" "write" (func $write (param i32 i32))) | ||
(memory 1) ;; at least 64 KB | ||
(func (export "write_utf8") | ||
i32.const 0 ;; offset of 0 | ||
i32.const 13 ;; length of 13 | ||
(call $write)) | ||
(func (export "modify_utf8") (param $offset i32) | ||
(i32.store | ||
(local.get $offset) | ||
(i32.add (i32.load (local.get $offset)) (i32.const 1))))) | ||
(memory 1)) ;; at least 64 KB |
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