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 separate thread for finalisation #16

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

jacob-hughes
Copy link

This commit creates a finalisation thread in the GC_INIT() routine. The thread spins indefinitely waiting to process objects in the finaliser buffers.

This commit also makes sure that once an object has been finalised, its finalised bit is set so that it is not re-added to the buffer the next time it becomes unreachable.

fnlz_mlc.c Outdated
@@ -22,8 +22,10 @@
#if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
/* The first bit is already used for a debug purpose. */
# define FINALIZER_CLOSURE_FLAG 0x2
# define IS_FINALIZED_FLAG 0x3
Copy link
Member

Choose a reason for hiding this comment

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

Let's document what this flag means. I think it means HAS_BEEN_FINALIZED?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, fixed here: a3c3ff4

@ltratt
Copy link
Member

ltratt commented Apr 16, 2024

Please squash.

This commit creates a finalisation thread in the GC_INIT() routine. The
thread spins indefinitely waiting to process objects in the finaliser
buffers.

This commit also makes sure that once an object has been finalised, its
finalised bit is set so that it is not re-added to the buffer the next
time it becomes unreachable.
@jacob-hughes
Copy link
Author

Squashed

@ltratt ltratt added this pull request to the merge queue Apr 16, 2024
Merged via the queue into softdevteam:master with commit a601f2a Apr 16, 2024
2 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.

2 participants