This repository was archived by the owner on Dec 18, 2023. It is now read-only.
Set default stack size + static data size to 576KB#5
Open
guybedford wants to merge 3 commits into
Open
Conversation
guybedford
commented
May 23, 2017
| rm "$sfile~" | ||
|
|
||
| $BYNARYEN_ROOT/s2wasm "$sfile" > "$wastfile" | ||
| $BYNARYEN_ROOT/s2wasm "$sfile" -i 589824 -s 524288 > "$wastfile" |
Author
There was a problem hiding this comment.
Even better here may be -i 655360 to get a nice round (memory 10).
Author
|
Just setting the |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
(correction to #4 setting valid values)
When using WASM Explorer or WASM Fiddle, any use of the stack will cause a memory out of bounds exception.
By passing the -s option to s2wasm we can initialize the stack value to the top of the initial memory.
This PR sets the total stack + static data size to 576KB (which seems like a sensible default). Ideally these should be parameters into the service though to tune requirements. Also it should be possible to inspect the static data size of a compilation and ensure that the stack size is always a constant stack size value regardless of the static data size, which would be an even more sensible default.
This at now will at least allow experimentation with stack things, as this service is hopefully intended for.