Innocently looking union member swap
Reini Urban [Sun, 6 Dec 2009 14:31:23 +0000 (14:31 +0000)]
This helps statically initializing union members on gcc,
otherwise we get "initializer element is not computable at load time".
This speeds up initializing larger B::C/B::CC compiled programs with -O1/-O2 by 10%.

sv.h

diff --git a/sv.h b/sv.h
index b452b36..fc1b475 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -103,10 +103,10 @@ typedef struct hek HEK;
 
 #define _SV_HEAD_UNION \
     union {                            \
+       char*   svu_pv;         /* pointer to malloced string */        \
        IV      svu_iv;                 \
        UV      svu_uv;                 \
        SV*     svu_rv;         /* pointer to another SV */             \
-       char*   svu_pv;         /* pointer to malloced string */        \
        SV**    svu_array;              \
        HE**    svu_hash;               \
        GP*     svu_gp;                 \