-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
bpo-1635741: Port gc module to multiphase initialization #23377
Conversation
a6884f9
to
668780e
Compare
🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 668780e30978e11065113c438850074f3fefab5b 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
LGTM, but I added the buildbot label because the gc module has some special handling on deallocation |
refleak bots are complaining about a new reference like in |
Found it! |
🤖 New build scheduled with the buildbot fleet by @tiran for commit d1d2cbcb6b14b2f2d8464cb56095b44a4e118ac6 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Modules/gcmodule.c
Outdated
} | ||
|
||
assert(gcstate->callbacks == NULL); | ||
gcstate->callbacks = PyList_New(0); |
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.
This looks wrong to me. If you create multiple instances of the GC modul, callbacks member will be overriden by a new list at each call. It must be initialized exactly once in _PyGC_Init().
By the way, if (gcstate->garbage == NULL) {
test in _PyGC_Init() can be removed, it's useless. This function is called exactly once per interpreter.
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.
Makes sense, I'm moving gcstate->callbacks = PyList_New(0)
to _PyGC_Init()
.
Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
d1d2cbc
to
7ad98d9
Compare
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.
LGTM.
@tiran: Status check is done, and it's a pending ❌ . |
@tiran: Status check is done, and it's a success ✅ . |
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue1635741
Automerge-Triggered-By: GH:tiran