emscripten-core / emscripten-core/emscripten

Heap growth notifications

Open
#12,336 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

It would be great if ```updateGlobalBufferAndViews``` could notify embedder(s) and application code that the heap has been resized, I don't see any way to get at this information currently. Right now if the heap grows, any live typed arrays pointing at the wasm heap become useless garbage, which makes it very difficult to make use of typed arrays safely when interacting with a compiled wasm binary. The fact that detached arrays are intentionally designed to fail silently makes this hard to debug as well. If there were a notification or signal we could process, that would make it possible to at least build a "safe typedarray" abstraction around this with adequate performance characteristics (wrap a typedarray instance, indirect into it with get/set methods, etc)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.