-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-139103: Improve namedtuple scaling in free-threaded build #144332
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
Changes from 1 commit
3600622
382e937
6edb13f
f09d89a
596d359
7d89766
e3ae10e
eb9d185
c53a02f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| #include "pycore_long.h" // _PyLong_GetOne() | ||
| #include "pycore_modsupport.h" // _PyArg_NoKeywords() | ||
| #include "pycore_object.h" // _PyObject_GC_UNTRACK() | ||
| #include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount() | ||
| #include "pycore_pyerrors.h" // _PyErr_Occurred() | ||
| #include "pycore_setobject.h" // _PySet_NextEntry() | ||
| #include "pycore_stats.h" | ||
|
|
@@ -1868,7 +1869,15 @@ PyStaticMethod_New(PyObject *callable) | |
| staticmethod *sm = (staticmethod *) | ||
| PyType_GenericAlloc(&PyStaticMethod_Type, 0); | ||
| if (sm != NULL) { | ||
| _PyObject_SetDeferredRefcount((PyObject *)sm); | ||
|
Member
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. Should we also call it in sm_init()? If not, should we move this _PyObject_SetDeferredRefcount() call to typeobject.c after the two PyStaticMethod_New() calls?
Contributor
Author
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. Hmmm... maybe? We'll need to guard the call to I'll update this after your PR is merged
Member
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. I merged for classmethod/staticmethod fix in the main branch.
Contributor
Author
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. I've put the calls to |
||
| sm->sm_callable = Py_NewRef(callable); | ||
| } | ||
| return (PyObject *)sm; | ||
| } | ||
|
|
||
| PyObject * | ||
| _PyStaticMethod_GetFunc(PyObject *self) | ||
| { | ||
| staticmethod *sm = _PyStaticMethod_CAST(self); | ||
| return sm->sm_callable; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.