boa icon indicating copy to clipboard operation
boa copied to clipboard

Investigate other API models for our GC

Open jedel1043 opened this issue 2 years ago • 1 comments

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:

  • Disallows sharing JsValues between Contexts in the same thread.
  • Makes it really easy to root and unroot values, while being 100% safe to human error.
  • Has compatibility with all GC algorithms, including compaction.
  • Allows having concurrent and/or parallel garbage collectors.
  • Snapshotting support

jedel1043 avatar Mar 04 '23 19:03 jedel1043

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

jasonwilliams avatar Jun 13 '24 12:06 jasonwilliams