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

Use pointer tagging to avoid clearing chunks at start of GC #4364

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

dipinhora
Copy link
Contributor

As part of #4143, the logic was changed to avoid clearing chunks at the start of GC (except for sizeclass 0) by using a sentinel value in the chunk->shallow field.

This commit, changes the implementation to rely on pointer tagging of the chunk->m field using the lowest bit to track whether a chunk needs to be cleared or not. The sentinel in the chunk->shallow is no longer needed/used allowing for this optimization to work for all sizeclasses (including the previously excluded sizeclass 0). All accesses to the chunk->m field now go through the utility function get_m to clear out the tagged bit first.

As part of ponylang#4143, the logic was
changed to avoid clearing chunks at the start of GC (except for
sizeclass 0) by using a sentinel value in the `chunk->shallow` field.

This commit, changes the implementation to rely on pointer tagging of
the `chunk->m` field using the lowest bit to track whether a chunk
needs to be cleared or not. The sentinel in the `chunk->shallow` is
no longer needed/used allowing for this optimization to work for
all sizeclasses (including the previously excluded sizeclass 0). All
accesses to the `chunk->m` field now go through the utility function
`get_m` to clear out the tagged bit first.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jul 12, 2023
@SeanTAllen SeanTAllen merged commit 1d7c6d6 into ponylang:main Jul 16, 2023
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jul 16, 2023
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