This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
BASEOP isn't an exact multiple of 8 bytes, so reordering pmop and cop
authorNicholas Clark <nick@ccl4.org>
Tue, 15 May 2007 07:36:57 +0000 (07:36 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 15 May 2007 07:36:57 +0000 (07:36 +0000)
to put a 32 bit member first elimiates structure padding on LP64.

p4raw-id: //depot/perl@31218

cop.h
op.h

diff --git a/cop.h b/cop.h
index 8b59917..725aab4 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -135,6 +135,9 @@ typedef struct jmpenv JMPENV;
 
 struct cop {
     BASEOP
+    /* On LP64 putting this here takes advantage of the fact that BASEOP isn't
+       an exact multiple of 8 bytes to save structure padding.  */
+    line_t      cop_line;       /* line # of this command */
     char *     cop_label;      /* label for this construct */
 #ifdef USE_ITHREADS
     char *     cop_stashpv;    /* package line was compiled in */
@@ -145,7 +148,6 @@ struct cop {
 #endif
     U32                cop_hints;      /* hints bits from pragmata */
     U32                cop_seq;        /* parse sequence number */
-    line_t      cop_line;       /* line # of this command */
     /* Beware. mg.c and warnings.pl assume the type of this is STRLEN *:  */
     STRLEN *   cop_warnings;   /* lexical warnings bitmask */
     /* compile time state of %^H.  See the comment in op.c for how this is
diff --git a/op.h b/op.h
index 13fb30e..2d46fcf 100644 (file)
--- a/op.h
+++ b/op.h
@@ -313,6 +313,9 @@ struct listop {
 
 struct pmop {
     BASEOP
+    /* On LP64 putting this here takes advantage of the fact that BASEOP isn't
+       an exact multiple of 8 bytes to save structure padding.  */
+    U32                op_pmflags;
     OP *       op_first;
     OP *       op_last;
 #ifdef USE_ITHREADS
@@ -320,7 +323,6 @@ struct pmop {
 #else
     REGEXP *    op_pmregexp;            /* compiled expression */
 #endif
-    U32                op_pmflags;
     union {
        OP *    op_pmreplroot;          /* For OP_SUBST */
 #ifdef USE_ITHREADS