]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128972: Add `_Py_ALIGN_AS` and revert `PyASCIIObject` memory layout. (GH-133085)
authorPetr Viktorin <encukou@gmail.com>
Fri, 2 May 2025 16:30:40 +0000 (18:30 +0200)
committerGitHub <noreply@github.com>
Fri, 2 May 2025 16:30:40 +0000 (18:30 +0200)
commit987e45e6326c6174fb7a300f44b9d8e4e26370c9
tree84419f99bf1b183cbe5643344bd3e9dd05814211
parentd78768e3d69fec730760f6e59c91fd12f2a00d11
gh-128972: Add `_Py_ALIGN_AS` and revert `PyASCIIObject` memory layout. (GH-133085)

Add `_Py_ALIGN_AS` as per C API WG vote: https://github.com/capi-workgroup/decisions/issues/61
This patch only adds it to free-threaded builds; the `#ifdef Py_GIL_DISABLED`
can be removed in the future.

Use this to revert `PyASCIIObject` memory layout for non-free-threaded builds.
The long-term plan is to deprecate the entire struct; until that happens
it's better to keep it unchanged, as courtesy to people that rely on it despite
it not being stable ABI.
Include/cpython/unicodeobject.h
Include/pymacro.h
Misc/NEWS.d/next/C_API/2025-04-28-15-36-01.gh-issue-128972.8bZMIm.rst [new file with mode: 0644]
Objects/unicodeobject.c