-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API #113584
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
cd4863c
gh-111968: Introduce _Py_freelist_state and _PyFreeListState_GET API
corona10 333873d
nit
corona10 8b7e261
Remove comment
corona10 dd0afa2
Update _PyList_Fini
corona10 f0d55de
nit refactor
corona10 5e8e3b4
fix
corona10 7aa956a
Update finalize step
corona10 908ef13
pep7
corona10 0096383
Update
corona10 bc8dd4a
Update
corona10 40bad6b
fix
corona10 1b0f370
fix
corona10 3d6042e
fix
corona10 09403db
fix
corona10 c05491e
Update
corona10 d5f9559
fix
corona10 3dd3c3f
update
corona10 0d8ea53
nit
corona10 e9d8138
Address code review
corona10 07e0536
Update Python/pylifecycle.c
corona10 6c8ba67
Address code review
corona10 8a80970
Address code review
corona10 6d2f2d4
nit
corona10 887bacf
Use _Py_FinalizeFreeLists
corona10 e65952f
nit
corona10 25a6714
fix
corona10 3fd9baa
fix
corona10 e175b61
fix
corona10 295a292
nit
corona10 5836c4b
nit
corona10 7cb261f
nit
corona10 01bbc7a
Revert naming of clear_all_freelists
corona10 b08f65f
Use _Py_ClearFreeLists as possible
corona10 65cedee
nit
corona10 9a40708
Fix finalize code
corona10 af86a20
nit
corona10 4e84130
Merge remote-tracking branch 'upstream/main' into gh-111968
corona10 7ffa64c
Split implementation
corona10 d6a2feb
Add files
corona10 458aadb
nit
corona10 b105bda
nit
corona10 18e9216
fix
corona10 5bb8d3f
nit
corona10 2811a12
fix
corona10 a5f494d
fix compiler warn
corona10 837ae60
nit
corona10 08c8613
fix
corona10 b5eb472
Adjust comment
corona10 0d8dc3d
2 tabs, not 8 spaces
erlend-aasland fe859e1
Rename to _PyGC_ClearAllFreeLists
corona10 c284061
Pass is_finalization to _PyList_ClearFreeList
corona10 a8e39b3
fix
corona10 99ac375
fix
corona10 0c331c7
fix
corona10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1727,6 +1727,11 @@ flush_std_files(void) | |
|
||
*/ | ||
|
||
static void | ||
finalize_free_lists(PyFreeListState *state) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following functions will be moved here in the end.
|
||
{ | ||
_PyList_Fini(state); | ||
} | ||
|
||
static void | ||
finalize_interp_types(PyInterpreterState *interp) | ||
|
@@ -1752,13 +1757,26 @@ finalize_interp_types(PyInterpreterState *interp) | |
_PyUnicode_ClearInterned(interp); | ||
|
||
_PyDict_Fini(interp); | ||
_PyList_Fini(interp); | ||
_PyTuple_Fini(interp); | ||
|
||
_PySlice_Fini(interp); | ||
|
||
_PyUnicode_Fini(interp); | ||
_PyFloat_Fini(interp); | ||
|
||
#if defined(Py_GIL_DISABLED) | ||
HEAD_LOCK(&_PyRuntime); | ||
_PyThreadStateImpl *tstate = (_PyThreadStateImpl *)interp->threads.head; | ||
while (tstate != NULL) { | ||
finalize_free_lists(&tstate->freelist_state); | ||
tstate = (_PyThreadStateImpl *)tstate->base.next; | ||
} | ||
HEAD_UNLOCK(&_PyRuntime); | ||
#else | ||
PyFreeListState *state = _PyFreeListState_GET(); | ||
finalize_free_lists(state); | ||
#endif | ||
|
||
#ifdef Py_DEBUG | ||
_PyStaticObjects_CheckRefcnt(interp); | ||
#endif | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following functions will be moved here in the end.