Message416434
Objects/obmalloc.c currently relies on the SIZEOF_VOID_P macro:
---
#if SIZEOF_VOID_P > 4
#define ALIGNMENT 16 /* must be 2^N */
#define ALIGNMENT_SHIFT 4
#else
#define ALIGNMENT 8 /* must be 2^N */
#define ALIGNMENT_SHIFT 3
#endif
---
If we want to respect sizeof(max_align_t) alignment, we can compute sizeof(max_align_t) in configure and uses the result in obmalloc.c. I expect that it's either 16 or 32, so we can maybe just hardcode ALIGNMENT_SHIFT using something like: "if == 32 ... #elif == 16 ... #else #error ...".
On x86 (32-bit) Fedora 35, gcc says 48 for sizeof(max_align_t) which is way larger than the current alignment to 8 bytes! |
|
Date |
User |
Action |
Args |
2022-03-31 13:44:19 | vstinner | set | recipients:
+ vstinner, pitrou, petr.viktorin, methane |
2022-03-31 13:44:19 | vstinner | set | messageid: <1648734259.55.0.892938220584.issue47179@roundup.psfhosted.org> |
2022-03-31 13:44:19 | vstinner | link | issue47179 messages |
2022-03-31 13:44:19 | vstinner | create | |
|