This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients methane, petr.viktorin, pitrou, vstinner
Date 2022-03-31.13:44:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648734259.55.0.892938220584.issue47179@roundup.psfhosted.org>
In-reply-to
Content
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!
History
Date User Action Args
2022-03-31 13:44:19vstinnersetrecipients: + vstinner, pitrou, petr.viktorin, methane
2022-03-31 13:44:19vstinnersetmessageid: <1648734259.55.0.892938220584.issue47179@roundup.psfhosted.org>
2022-03-31 13:44:19vstinnerlinkissue47179 messages
2022-03-31 13:44:19vstinnercreate