Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out API for malloc with buffered finalization #14

Closed

Conversation

jacob-hughes
Copy link

This introduces a new malloc function GC_buffered_finalize_malloc which ensures that unreachable objects are added to a 4KiB thread-local buffer to be later finalized. Once the buffer is full, it's passed to a user supplied closure.

The disclaim API in Boehm has no mechanism for detecting which allocations in a free-list are simply empty and which require finalizing. So in order to get around this we change mark procedure, using an extra bit in the object header to determine whether or not an object has a finalization closure.

This introduces a new malloc function `GC_buffered_finalize_malloc` which
ensures that unreachable objects are added to a 4KiB thread-local buffer to
be later finalized. Once the buffer is full, it's passed to a user supplied
closure.

The disclaim API in Boehm has no mechanism for detecting which
allocations in a free-list are simply empty and which require finalizing.
So in order to get around this we change mark procedure, using an extra bit
in the object header to determine whether or not an object has a
finalization closure.
@jacob-hughes
Copy link
Author

Closing based on offline discussion

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