Nick Coghlan added the comment:

The core motivation driving the original refactoring was to better understand 
and consolidate our runtime state in order to clarify what the GIL is actually 
protecting (aside from the reference counts). That then turned out to have 
surprising performance benefits (presumably by way of loading all of this state 
permanently into the CPU cache and then keeping it there).

The changes to the public include files arise more from the fact we don't 
currently have a common place to put internal CPython headers for declarations 
we want to share across compilation modules.

I agree the latter is confusing, and it could be worth having a separate 
"Include/internal/CPython.h" header that outright failed the build if you 
attempted to include it without Py_BUILD_CORE set.

(This also ties into my comments on the PR, where I believe the current 
approach of mixing public and private state in the same structs will cause 
problems with compilers generating incorrect field offsets in extension modules 
and embedding applications)

----------

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

Reply via email to