STINNER Victor <vstin...@python.org> added the comment:

> Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END

I excluded the TRASHCAN API from the limited C API:

commit 0fa4f43db086ac3459811cca4ec5201ffbee694a
Author: Victor Stinner <vstin...@python.org>
Date:   Wed Feb 5 12:23:27 2020 +0100

    bpo-39542: Exclude trashcan from the limited C API (GH-18362)
    
    Exclude trashcan mechanism from the limited C API: it requires access to
    PyTypeObject and PyThreadState structure fields, whereas these structures
    are opaque in the limited C API.
    
    The trashcan mechanism never worked with the limited C API. Move it
    from object.h to cpython/object.h.

Then I modified these macros to hide implementation details:

commit 38965ec5411da60d312b59be281f3510d58e0cf1
Author: Victor Stinner <vstin...@python.org>
Date:   Fri Mar 13 16:51:52 2020 +0100

    bpo-39947: Hide implementation detail of trashcan macros (GH-18971)
    
    Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer
    access PyThreadState attributes, but call new private
    _PyTrash_begin() and _PyTrash_end() functions which hide
    implementation details.

> Py_EnterRecursiveCall, Py_LeaveRecursiveCall, _Py_MakeRecCheck

Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() are now function calls. I 
move the "inline" implementation the internal C API.

commit 224481a8c988fca12f488544edd2f01c0af2a91d
Author: Victor Stinner <vstin...@python.org>
Date:   Fri Mar 13 10:19:38 2020 +0100

    bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)
    
    Move the static inline function flavor of Py_EnterRecursiveCall() and
    Py_LeaveRecursiveCall() to the internal C API: they access
    PyThreadState attributes. The limited C API provides regular
    functions which hide implementation details.


> Py_ALLOW_RECURSION, Py_END_ALLOW_RECURSION

Oh right, these macros should be modified to not access 
PyThreadState.recursion_critical member directly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35949>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to