This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eric.snow, ncoghlan, scoder, vstinner
Date 2020-06-25.09:25:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593077143.35.0.795903021657.issue35949@roundup.psfhosted.org>
In-reply-to
Content
> Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END

I excluded the TRASHCAN API from the limited C API:

commit 0fa4f43db086ac3459811cca4ec5201ffbee694a
Author: Victor Stinner <vstinner@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 <vstinner@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 <vstinner@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.
History
Date User Action Args
2020-06-25 09:25:43vstinnersetrecipients: + vstinner, ncoghlan, scoder, eric.snow
2020-06-25 09:25:43vstinnersetmessageid: <1593077143.35.0.795903021657.issue35949@roundup.psfhosted.org>
2020-06-25 09:25:43vstinnerlinkissue35949 messages
2020-06-25 09:25:43vstinnercreate