Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
[WIP] gh-133931: Introduce _PyObject_XSetRefDelayed to replace Py_XSETREF#134377
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Objects/obmalloc.c Outdated
_PyObject_XSetRefDelayed(PyObject **ptr, PyObject *value) | ||
{ | ||
PyObject *old = *ptr; | ||
FT_ATOMIC_STORE_PTR_RELEASE(*ptr, Py_NewRef(value)); |
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.
The default build implementation inpycore_pymem.h
doesn't include thePy_NewRef()
.
My preference is to keep thePy_NewRef(value)
in the callers, i.e.:
_PyObject_XSetRefDelayed(dictptr,Py_NewRef(value));
to match the semantics ofPy_XSETREF
.
Interesting... CI passed in my local but not in the CI.. :( |
Ah okay..
|
Why do we need Also, what is "delayed"? Either choose a clearer name, or add an explanatory comment in the header file. |
Uh oh!
There was an error while loading.Please reload this page.
gen_set_name
andgen_set_qualname
thread-safe in free-threaded builds #133931