-
Notifications
You must be signed in to change notification settings - Fork 11
Add heap information as primitive and to debugger #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
95636f6
Add used heap size as primitive
abelstuker 182bed9
Add debugger support for used heap size
abelstuker 1b48ded
Fix deprecated mallinfo and nonexisting header
abelstuker 2b87cdc
Fix header
abelstuker 194ddbd
Fix header
abelstuker 0e542a9
Fix ESP-IDF header
abelstuker 09bf535
Fix formatting
abelstuker a7babb1
Fix debugger dump
abelstuker d7caabe
Fix formatting
abelstuker 28f0422
Remove heap information from snapshot
abelstuker 49cc7b0
Add tutorial example for heap size primitive
abelstuker 65da039
Rename heap size example to heap used
abelstuker 895667e
Fix number of snapshot state bytes
abelstuker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ;; This test program shows how to use the `heap_used` function | ||
| ;; to determine how much of the heap is currently in use. | ||
|
|
||
| ;; The same used heap size can be obtained from the debugger, | ||
| ;; but note that the debugger introduces some overhead, so | ||
| ;; the value obtained there may be slightly higher | ||
| ;; than the value obtained from teh `heap_used` primitive. | ||
|
|
||
| (module | ||
| (import "env" "heap_used" (func $heap_used (result i32))) | ||
| (import "env" "print_int" (func $print_int (param i32))) | ||
| (memory (export "memory") 1) | ||
|
|
||
| (func (export "main") | ||
| (call $heap_used) ;; A | ||
| (call $print_int) | ||
|
|
||
| (memory.grow (i32.const 1)) ;; grow memory by 1 page (64KB = 65536 bytes) | ||
| (drop) | ||
|
|
||
| (call $heap_used) ;; should be >= A + 65536 | ||
| (call $print_int) | ||
| ) | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.