Skip to content

bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() - #23044

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:interp_clear
Oct 30, 2020
Merged

bpo-42208: Call GC collect earlier in PyInterpreterState_Clear()#23044
vstinner merged 1 commit into
python:masterfrom
vstinner:interp_clear

Conversation

@vstinner

@vstinner vstinner commented Oct 30, 2020

Copy link
Copy Markdown
Member

The last GC collection is now done before clearing builtins and sys
dictionaries. Add also assertions to ensure that gc.collect() is no
longer called after _PyGC_Fini().

Pass also the tstate to PyInterpreterState_Clear() to pass the
correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().

https://bugs.python.org/issue42208

The last GC collection is now done before clearing builtins and sys
dictionaries. Add also assertions to ensure that gc.collect() is no
longer called after _PyGC_Fini().

Pass also the tstate to PyInterpreterState_Clear() to pass the
correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().
@vstinner
vstinner requested a review from pablogsal as a code owner October 30, 2020 20:50
@vstinner
vstinner merged commit eba5bf2 into python:master Oct 30, 2020
@vstinner
vstinner deleted the interp_clear branch October 30, 2020 21:51
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…honGH-23044)

The last GC collection is now done before clearing builtins and sys
dictionaries. Add also assertions to ensure that gc.collect() is no
longer called after _PyGC_Fini().

Pass also the tstate to PyInterpreterState_Clear() to pass the
correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants