8000 gh-120198: Stop the world when setting __class__ on free-threaded build by Fidget-Spinner · Pull Request #120672 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120198: Stop the world when setting __class__ on free-threaded build #120672

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 8 commits into from
Jul 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
10000
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into class_stoptheworld
  • Loading branch information
Fidget-Spinner committed Jun 19, 2024
commit a88d2387966613d61f01baa2fd9a756329ee6302
22 changes: 16 additions & 6 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,22 @@ _Py_IsOwnedByCurrentThread(PyObject *ob)
}
#endif

// bpo-39573: The Py_SET_TYPE() function must be used to set an object type.
static inline PyTypeObject* Py_TYPE(PyObject *ob) {
return ob->ob_type;
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
// Py_TYPE() implementation for the stable ABI
PyAPI_FUNC(PyTypeObject*) Py_TYPE(PyObject *ob);

#if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030e0000
// Stable ABI implements Py_TYPE() as a function call
// on limited C API version 3.14 and newer.
#else
static inline PyTypeObject* _Py_TYPE(PyObject *ob)
{
return ob->ob_type;
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST(ob))
#else
# define Py_TYPE(ob) _Py_TYPE(ob)
#endif
#endif

PyAPI_DATA(PyTypeObject) PyLong_Type;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0