[issue33589] Remove dummy member in GCHead

2018-05-21 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +twouters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread INADA Naoki
INADA Naoki added the comment: I grepped quickly and I can't find existing usage of anonymous union/struct. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker __

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread INADA Naoki
INADA Naoki added the comment: Oh,,, while even gcc 4.0 supported it, it is language spec from C11, not C99. -- ___ Python tracker ___ _

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm fine with an anonymous struct. Is it standard C these days? -- ___ Python tracker ___ ___ Pyt

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread INADA Naoki
INADA Naoki added the comment: Make sense. Then, what about using anonymous struct to make GC code more readable? typedef union _gc_head { struct { union _gc_head *gc_next; union _gc_head *gc_prev; Py_ssize_t gc_refs; -} gc; +}; double dummy; /* f

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Short of adding a `tp_alignment`, though, I think we should not make things harder for the common cases. This means we should probably keep the "double" member to ensure that extension types that have a "double" field in their object struct have the right al

[issue33589] Remove dummy member in GCHead

2018-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: >From the linked changeset message: > unless anyone knows of a platform where ssize_t is 4 bytes? That's most 32-bit platforms, right? Basically, size_t and ssize_t are pointer-sized except on some rare architectures. > A more correct non-hacky alternative

[issue33589] Remove dummy member in GCHead

2018-05-20 Thread INADA Naoki
New submission from INADA Naoki : https://github.com/python/cpython/commit/e348c8d154cf6342c79d627ebfe89dfe9de23817 > We can probably get rid of the double and this union hack all together today. > That is a slightly more invasive change that can be left for later. Can we do it for now (Python