| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
The only backward incompatible change is that #include "pyatomic.h" no longer works: #include "internal/pyatomic.h" must be used instead... But this header is really specific to Python internals, its full content was surrounded by #ifdef Py_BUILD_CORE. Third-party C extensions must not use Py_BUILD_CORE. In know that in the past, debuggers like vmprof required to access _PyThreadState_Current, but:
I'm talking about this macro which requires pyatomic.h: /* Variable and macro for in-line access to current thread state */
/* Assuming the current thread holds the GIL, this is the
PyThreadState for the current thread. */
#ifdef Py_BUILD_CORE
# define _PyThreadState_Current _PyRuntime.gilstate.tstate_current
# define PyThreadState_GET() \
((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
We don't want to export pyatomic.h because its the header leaks its implementation, and the implementation highly depend on the compiler and compiler flags. This header is included in Python.h but its content wasn't first protected by #ifdef Py_BUILD_CORE which caused many troubles with C++ compilers for example. |
Sorry, something went wrong.
|
Would not be better to move files with the content fully surrounded by #ifdef Py_BUILD_CORE out of the Include/ directory? |
Sorry, something went wrong.
There was a problem hiding this comment.
Update Windows build files?
Sorry, something went wrong.
Right now, I'm not sure if third party projects require Py_BUILD_CORE code or not... I prefer to continue the previous work to move code into Include/internal/. It seems like Include/internal/ is not installed by python3-devel on Fedora. So Include/internal/ is not usable by 3rd party modules on Fedora at least. |
Sorry, something went wrong.
* Add pyatomic.h to the VS project (it wasn't referenced) * Don't include pyatomic.c in internal/pystate.h
pyatomic.h wasn't included in the VS project. I fixed that. |
Sorry, something went wrong.
I copied your question at https://bugs.python.org/issue35081#msg328922 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue35081