diff options
author | Petr Viktorin <encukou@gmail.com> | 2025-06-11 12:44:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-11 12:44:58 +0200 |
commit | 49d72365cd2d6c09a154a9a061efef4130e2c758 (patch) | |
tree | 39c318acad08458621004e4eff90a26d6d4774ed /Lib/html/parser.py | |
parent | 2b8b4774d29a707330d463f226630185cbd3ceff (diff) | |
download | cpython-49d72365cd2d6c09a154a9a061efef4130e2c758.tar.gz cpython-49d72365cd2d6c09a154a9a061efef4130e2c758.zip |
gh-127545: Add _Py_ALIGNED_DEF(N, T) and use it for PyObject (GH-135209)
* Replace _Py_ALIGN_AS(V) by _Py_ALIGNED_DEF(N, T)
This is now a common façade for the various `_Alignas` alternatives,
which behave in interesting ways -- see the source comment.
The new macro (and MSVC's `__declspec(align)`) should not be used
on a variable/member declaration that includes a struct declaraton.
A workaround is to separate the struct definition.
Do that for `PyASCIIObject.state`.
* Specify minimum PyGC_Head and PyObject alignment
As documented in InternalDocs/garbage_collector.md, the garbage collector
stores flags in the least significant two bits of the _gc_prev pointer
in struct PyGC_Head. Consequently, this pointer is only capable of storing
a location that's aligned to a 4-byte boundary.
Encode this requirement using _Py_ALIGNED_DEF.
This patch fixes a segfault in m68k, which was previously investigated
by Adrian Glaubitz here:
https://lists.debian.org/debian-68k/2024/11/msg00020.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087600
Original patch (using the GCC-only Py_ALIGNED) by Finn Thain.
Co-authored-by: Finn Thain <fthain@linux-m68k.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Diffstat (limited to 'Lib/html/parser.py')
0 files changed, 0 insertions, 0 deletions