bytecodealliance / ComponentizeJS

JS -> WebAssembly Component
Apache License 2.0
242 stars 32 forks source link

Rooting array buffers #1

Open guybedford opened 1 year ago

guybedford commented 1 year ago

The current GC strategy is to just clear all allocations at the end of each call, but we need to allow the JS ArrayBuffers to hold on to the memory they expose. This likely involves integration into the JS GC to ensure it can become a managed pointer in the engine.

guybedford commented 3 months ago

This is still a very important issue to resolve. We need to properly integrate the cabi_post calls so that they free non-rooted data, and retain the rooted data structures. In the case of rooted data structures, the pointer is the target of the free call to integrate into the JS GC (zero-copy strings and typed arrays).