[issue33589] Remove dummy member in GCHead

INADA Naoki report at bugs.python.org
Mon May 21 10:20:11 EDT 2018


INADA Naoki <songofacandy at gmail.com> 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;  /* force worst-case alignment */
 } PyGC_Head;

All code like g->gc.gc_next will be like g->gc_next.

----------

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


More information about the Python-bugs-list mailing list