[issue27987] obmalloc's 8-byte alignment causes undefined behavior

Benjamin Peterson report at bugs.python.org
Thu Nov 9 01:25:35 EST 2017


Benjamin Peterson <benjamin at python.org> added the comment:

On Wed, Nov 8, 2017, at 06:14, STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner at gmail.com> added the comment:
> 
> alignment.patch: +    long double dummy;  /* force worst-case alignment
> */
> 
> Would it be possible to use max_align_t mentioned by Stefan, at least
> when this type is available?

Yes, that would be the correct thing to do. I was looking for the quick
hack.

> 
> What is the impact of the patch on objects size?

On 64-bit platforms, I believe it wastes a word for GC objects.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27987>
_______________________________________


More information about the Python-bugs-list mailing list