Uh oh!
There was an error while loading. Please reload this page.
gh-112532: Use separate mimalloc heaps for GC objects - #113263
Merged
Conversation
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
--disable-gilbuilds, we now use four separate heaps in preparation for when we will use mimalloc to find GC objects when the GIL is disabled. This requires making a few changes to mimalloc:mi_heap_tandmi_tld_tinitialization is split from allocation. This allows us to have ami_tld_tper-PyThreadState, which is important to keep interpreter isolation, since the same OS thread may run in multiple interpreters (using different PyThreadStates.)Heap abandoning (
mi_heap_collect_ex) can now be called from a different thread than the one that created the heap. This is necessary because we may clear and delete the containing PyThreadStates from a different thread during finalization and after fork().--disable-gilbuilds #112532