WebAssembly / WebAssembly/spec
[JS Generator] Add scope for each wasm instance
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 3.5k
- Forks
- 539
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 13
Description
The live range of the wasm instance created by JS Generator is global, likes:
let $1 = instance(...);
assert...($1, ...);
let $2 = instance(...);
assert...($2, ...);
Tests such as memory_copy.wast and memory_init.wast, usually contain many instances. When executing these tests on some machines, out of memory fails may be reported.
Can you add a scope to each instance so that they are destroyed after use ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JS Generator and inspect how instance(...) calls are emitted for memory_copy.wast and memory_init.wast. Confirm that each generated instance is scoped so it can be destroyed after its assertions; run those tests and verify that repeated instances no longer retain unnecessary memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100