Rename resize_memory to grow_memory, following the design.#134
Rename resize_memory to grow_memory, following the design.#134sunfishcode merged 4 commits intomasterfrom
resize_memory to grow_memory, following the design.#134Conversation
The previous code interpreted `resize_memory` as an absolute size; this patch also changes it to be a delta as described in the design. Also, refactor resizing.wast to be independent of the host page size.
|
Looks good to me, other than the question about trap vs OOM. |
|
Yes, a dedicated exception would be better. Also, this makes me notice bugs due to not using unsigned arithmetic. I reused I64's unsigned operators here to fix this, though that breaks its encapsulation a little, it seems significantly more convenient than alternatives. Patch updated. PTAL, thanks! |
|
LGTM, although I find the name |
|
What do you think of the name |
|
Hm, I'm confused in what sense it is an overflow at all. |
|
When the mathematical value of size + delta is too great to be represented as an unsigned number in the result type, it's an unsigned overflow. |
|
Ah, sorry, you are right, I missed that due to these values being assumed to be unsigned, an overflow is the only reason that new_size < old_size can fail. Okay, in that case, Sorry for the noise! |
|
Renamed AddressOverflow to SizeOverflow. Merging with LGTM above and the rename. Thanks! |
Rename `resize_memory` to `grow_memory`, following the design.
|
Would I be reading this right that the maximum memory this supports is 2GB-1? Is this just an implementation limitation for the current spec tools, or has a decision been made that the size is interpreted as a signed number? |
|
This patch is attempting to interpret the size as unsigned everywhere, and even corrects some code that previously interpreted it as signed. Did I miss any places? |
|
Ah, looking at it again, I did miss some places. max_int is the max signed int. I'll submit a new PR to fix that. |
[test] Integrate load extend and 64x2 conversions ops from WAVM
After the spec change in WebAssembly#126, byte copying order is not observable.
Update repos:
wasm-3.0:
WebAssembly@87a61ac
This change was automatically generated by `update-testsuite.py`
Co-authored-by: WebAssembly/testsuite auto-update <github-actions@users.noreply.github.com>
The previous code interpreted
resize_memoryas an absolute size; thispatch also changes it to be a delta as described in the design.
Also, refactor resizing.wast to be independent of the host page size.