Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork669
Add amemory.grow
handler in the RT#2755
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
This handler can be used with an import for users not using ESM bindingsto recreate views into memory only when necessary.
If the test is supposed to compile, but compilation fails instead,there's no point in diffing fixtures (unless you like a wall of red inyour terminal). It also turns out that execution never reaches thediffing section, since writing the non-existent debug Wasm binary fails.
afd90e7
tode40b29
CompareUser can directly call |
Good point, although I thought that would be a niche case in comparison to the RT growing memory. Do you think a handler can/should be integrated with ESM/raw bindings to reduce the use of |
I'm not sure what is a better solution. Previously, we used similar approach (without try-catch + views) and that was may be a little less code but slower. I would do a some simple PoC and bench this first |
HerrCai0907 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do you think it is more convenient for developer if we have a functionmemory_grow
which will callmemory.grow
. Then developer can replace this function just like replacingtrace
.
It can give more freedom to hook memory grow. They can hook before and after memory grow.
Honestly the only use case I'm targeting is handling views of the Wasm memory being detached on I want to expand that into something that works with ESM bindings as well. I don't see the point in widening it to anything more general. Therefore, it's probably better to scrap what I have in this PR right now and figure out something that works for detecting grow events in at least ESM bindings. |
Changes proposed in this pull request:
⯈ Add an optional handler for calls to
memory.grow()
in the RT.⯈ Unrelatedly, skip fixture comparisons in tests if compiling them failed.
The question remains whether this could somehow be used within ESM bindings.