8000 gh-119247: Add macros to use PySequence_Fast safely in free-threaded build by MojoVampire · Pull Request #119315 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-119247: Add macros to use PySequence_Fast safely in free-threaded build #119315

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 9 commits into from
May 22, 2024
Prev Previous commit
Next Next commit
Tweak comments per review
Co-authored-by: Sam Gross <colesbury@gmail.com>
  • Loading branch information
MojoVampire and colesbury committed May 22, 2024
commit 1f3cec034c671148f30bc6a29e4b9430175a4c7e
10 changes: 5 additions & 5 deletions Include/internal/pycore_critical_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ extern "C" {
_PyCriticalSection2_End(&_cs2); \
}

// Specialized version of critical section locking called to safely use
// PySequence_Fast APIs under nogil
// For performance, the argument *to* PySequence_Fast is provided to the
// macro, not the *result* of PySequence_Fast (which would require an extra
// test to determine if the lock must be held)
// Specialized version of critical section locking to safely use
// PySequence_Fast APIs without the GIL. For performance, the argument *to*
// PySequence_Fast() is provided to the macro, not the *result* of
// PySequence_Fast(), which would require an extra test to determine if the
// lock must be acquired.
# define Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST(original) \
{ \
PyObject *_orig_seq = _PyObject_CAST(original); \
Expand Down
0