Skip to content

Research custom pointer implementation for boa gc#91

Open
shruti2522 wants to merge 3 commits into
boa-dev:mainfrom
shruti2522:custom-ptr
Open

Research custom pointer implementation for boa gc#91
shruti2522 wants to merge 3 commits into
boa-dev:mainfrom
shruti2522:custom-ptr

Conversation

@shruti2522

Copy link
Copy Markdown
Contributor

Related to #86

@shruti2522 shruti2522 changed the title Research custom pointer implementation for boa Research custom pointer implementation for boa gc Jun 17, 2026

@nekevss nekevss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a pretty good write up. I'm actually super excited to see this concept in action. Can you extend it with some actual example code?

It would be worth attempting to create a new allocator that relies on a custom pointer and implement some level of heap serialization.


// private

// TODO(perf): O(n) scan; replace with a sorted index at scale.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I left this as a linear O(n) scan for the prototype since pools will be small. For production, we should probably replace this with a sorted index or a direct chunk map for O(1) lookups

}

// overflow guard
if slot_count as u64 > super::MAX_SLOT_IDX as u64 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added explicit guards against slot_count arithmetic overflows and corrupt live_count data here. Since we are reading raw bytes from disk, we might want to throw a fuzzer at this deserializer in a follow up PR

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.

2 participants