[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2020-06-25 Thread STINNER Victor
STINNER Victor 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 Date: Wed Feb 5 12:23:27 2020 +0100 bpo-39542: Exclude trashcan from the limit

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2020-06-25 Thread STINNER Victor
STINNER Victor added the comment: I mark this issue as a duplicate of bpo-39947 "[C API] Make the PyThreadState structure opaque (move it to the internal C API)" since I already pushed multiple changes there. But this issue contains interesting technical information! -- resolution:

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-18 Thread Eric Snow
Eric Snow added the comment: Thanks for clarifying. :) On Mon, Feb 18, 2019 at 1:17 PM Stefan Behnel wrote: > The exception fields are performance critical, and we try hard to make them > visible to the C compiler so that swapping around exception state eats up as > little CPU time as possib

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-18 Thread Stefan Behnel
Stefan Behnel added the comment: Well … yes. The exception fields are performance critical, and we try hard to make them visible to the C compiler so that swapping around exception state eats up as little CPU time as possible. You could argue that profiling and tracing are less critical, but

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-18 Thread Eric Snow
Eric Snow added the comment: @Stefan, is it a problem for Cython if the relevant fields are exposed via C-API functions rather than directly on PyThreadState? -- ___ Python tracker _

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-16 Thread Stefan Behnel
Stefan Behnel added the comment: Oh, and I forgot the new trashcan support. Cython will also start to use that in its next release, so that adds the trashcan related attributes to the list. https://github.com/cython/cython/pull/2842/files -- ___ P

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-16 Thread Stefan Behnel
Stefan Behnel added the comment: >From Cython's point of view, the important fields in PyThreadState are the >tracing/profiling and exception related ones. We're not using anything else. >Users can explicitly opt out of the access to the exception fields by defining >a C macro, at the expens

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-13 Thread STINNER Victor
STINNER Victor added the comment: Same ratione than for PyInterpreterState: https://bugs.python.org/issue35886#msg335464 Except that I expect that a few more projects rely on PyThreadState fields. Maybe not. It's hard to guess :-( I mean that I'm ok-ish with the change but it should be care

[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-08 Thread Eric Snow
New submission from Eric Snow : (also see issue #35886) In November Victor created the Include/cpython directory and moved a decent amount of public (but not limited) API there. This included the PyThreadState struct. I'd like to move it into the "internal" headers since it is somewhat coup