8000 gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build by corona10 · Pull Request #127737 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build #127737

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 18 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
fix
  • Loading branch information
corona10 committed Dec 8, 2024
commit b714963eda575e35d45d54b04715b2315c324d8f
11 changes: 3 additions & 8 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5695,7 +5695,7 @@ _PyType_CacheInitForSpecialization(PyHeapTypeObject *type, PyObject *init,
int
_PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
{
int can_cache = 0;
int ret = 0;
if (!type) {
return -1;
}
Expand All @@ -5706,19 +5706,14 @@ _PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
PyFunctionObject *func = (PyFunctionObject *)descriptor;
uint32_t version = _PyFunction_GetVersionForCurrentState(func);
if (!_PyFunction_IsVersionValid(version)) {
can_cache = -1;
ret = -1;
goto end;
}
#ifdef Py_GIL_DISABLED
can_cache = _PyObject_HasDeferredRefcount(descriptor);
#else
can_cache = 0;
#endif
FT_ATOMIC_STORE_PTR_RELEASE(ht->_spec_cache.getitem, descriptor);
FT_ATOMIC_STORE_UINT32_RELAXED(ht->_spec_cache.getitem_version, version);
end:
END_TYPE_LOCK();
return can_cache;
return ret;
}

PyObject *
Expand Down
14 changes: 7 additions & 7 deletions Programs/test_frozenmain.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0