mirror of
https://github.com/python/cpython.git
synced 2026-04-22 03:41:08 +00:00
bpo-27987: align PyGC_Head to alignof(long double) (GH-13335)
This commit is contained in:
parent
c70ab1cca0
commit
ea2b76bdc5
2 changed files with 7 additions and 1 deletions
|
|
@ -255,7 +255,11 @@ typedef union _gc_head {
|
|||
union _gc_head *gc_prev;
|
||||
Py_ssize_t gc_refs;
|
||||
} gc;
|
||||
double dummy; /* force worst-case alignment */
|
||||
long double dummy; /* force worst-case alignment */
|
||||
// malloc returns memory block aligned for any built-in types and
|
||||
// long double is the largest standard C type.
|
||||
// On amd64 linux, long double requires 16 byte alignment.
|
||||
// See bpo-27987 for more discussion.
|
||||
} PyGC_Head;
|
||||
|
||||
extern PyGC_Head *_PyGC_generation0;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
``PyGC_Head`` structure is aligned to ``long double``. This is needed to
|
||||
GC-ed objects are aligned properly. Patch by Inada Naoki.
|
||||
Loading…
Add table
Add a link
Reference in a new issue