Rearrange the members of struct _node to put shorter fields towards
authorGuido van Rossum <guido@python.org>
Tue, 17 Sep 2002 03:24:09 +0000 (03:24 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 17 Sep 2002 03:24:09 +0000 (03:24 +0000)
the end, in the hope of saving some bytes on 64-bit machines.  (Too
bad n_nchildren can't be made an unsigned short, but
test/test_longexp.py specifically tests for more than 2**16 subtrees
at one level.)

I don't expect any binary compatibility issues here, unless someone
has an old binary of parsermodule.so saved away.

Include/node.h

index 8f5ef236aa8de6107556a67ef57a4fdf57f3494d..c909ec5a9fcfab011915941afb56da4138d0b106 100644 (file)
@@ -8,11 +8,11 @@ extern "C" {
 #endif
 
 typedef struct _node {
-    short              n_type;
     char               *n_str;
+    struct _node       *n_child;
     int                        n_lineno;
     int                        n_nchildren;
-    struct _node       *n_child;
+    short              n_type;
 } node;
 
 PyAPI_FUNC(node *) PyNode_New(int type);