Skip to content

docs(gc): document boa_gc API surface used by the engine#38

Merged
nekevss merged 5 commits intoboa-dev:mainfrom
mrhapile:docs/gc-api-surface
Mar 13, 2026
Merged

docs(gc): document boa_gc API surface used by the engine#38
nekevss merged 5 commits intoboa-dev:mainfrom
mrhapile:docs/gc-api-surface

Conversation

@mrhapile
Copy link
Contributor

@mrhapile mrhapile commented Mar 6, 2026

This PR documents the subset of the boa_gc API that the Boa engine
currently depends on.

ref - #27

Understanding the exact API surface used by the engine is important for:

  • future GC improvements
  • experimentation with alternative collectors
  • maintaining compatibility between the engine and the collector

The document describes pointer types, tracing traits, weak references,
interior mutability primitives, and runtime utilities relied upon by
the engine.

The goal is to provide a clear compatibility contract for any garbage
collector implementation that aims to replace boa_gc.

The document deliberately avoids internal implementation details (heap vectors, Box allocation, mark-stack internals) and focuses exclusively on the engine → GC interface boundary, making it suitable for inclusion in repository documentation.

mrhapile added 2 commits March 6, 2026 22:24
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
Copilot AI review requested due to automatic review settings March 6, 2026 20:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repository documentation that defines the Boa engine’s boa_gc dependency contract, capturing the specific public API surface that a replacement collector would need to support.

Changes:

  • Adds docs/boa_gc_api_surface.md describing the engine-facing boa_gc pointer types, traits, weak references/collections, macros, and runtime utilities.
  • Adds a small mark-sweep test that smoke-tests creating an oscars WeakGc from a strong Gc.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
oscars/src/collectors/mark_sweep/tests.rs Adds a minimal WeakGc creation smoke test for the mark-sweep collector.
docs/boa_gc_api_surface.md New documentation describing the intended boa_gc API compatibility contract used by the Boa engine.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a question and one issue.

}

/// Tests for the standalone WeakGc pointer behavior.
mod weak_gc_tests {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: tests are unrelated to the PR.

Please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soooo sorryyyy about that!!! I’ll remove those I must have accidentally staged them while working on another PR.

Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
@mrhapile
Copy link
Contributor Author

@nekevss could you look over this 🙂

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the write up!

@nekevss nekevss merged commit 502fc92 into boa-dev:main Mar 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants