boa-dev / boa

Boa is an embeddable and experimental Javascript engine written in Rust. Currently, it has support for some of the language.
MIT License
5.01k stars 397 forks source link

Investigate other API models for our GC #2631

Open jedel1043 opened 1 year ago

jedel1043 commented 1 year ago

Our current GC API uses a lot of reference counting to track the number of roots for an object, but this is necessary by our current API. It would be good to check out some other APIs to see how they handle garbage collection:

Our ideal API:

jasonwilliams commented 3 months ago

It may also be worth taking future proposals like https://github.com/tc39/proposal-structs into account when thinkin about "shared heaps" which can be accessed from multiple realms and how we GC that data once unreachable.

there’s also some requirements in this thread https://github.com/boa-dev/boa/issues/1372