Use a single upcall for all ToggleRefFinalizers (fixes #223) #227

Merged
BwackNinja merged 1 commit from fix-223 into main 2025-05-17 16:34:38 +02:00
BwackNinja commented 2025-05-17 00:11:11 +02:00 (Migrated from github.com)

I'm still not sure why the CodeHeap isn't cleaned up, but the cause is the ToggleRefFinalizer generating a new upcall stub every time it needs to be run. I Switched that to use a global upcall, passing in the MemorySegment. Now I no longer see the issue.

I'm still not sure why the CodeHeap isn't cleaned up, but the cause is the `ToggleRefFinalizer` generating a new upcall stub every time it needs to be run. I Switched that to use a global upcall, passing in the `MemorySegment`. Now I no longer see the issue.
jwharm commented 2025-05-17 16:34:34 +02:00 (Migrated from github.com)

This is awesome! Thanks a lot!

This is awesome! Thanks a lot!
jwharm commented 2025-05-17 16:38:01 +02:00 (Migrated from github.com)

Reusing the upcall stub should also improve performance in general, because g_object_remove_toggle_ref usually runs very often.

Reusing the upcall stub should also improve performance in general, because `g_object_remove_toggle_ref` usually runs very often.
Sign in to join this conversation.
No description provided.