From: Nicholas Clark Date: Tue, 15 May 2007 07:36:57 +0000 (+0000) Subject: BASEOP isn't an exact multiple of 8 bytes, so reordering pmop and cop X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7f23a062a625a1f0067a15d3cea5401ea21006c;p=p5sagit%2Fp5-mst-13.2.git BASEOP isn't an exact multiple of 8 bytes, so reordering pmop and cop to put a 32 bit member first elimiates structure padding on LP64. p4raw-id: //depot/perl@31218 --- diff --git a/cop.h b/cop.h index 8b59917..725aab4 100644 --- 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 --- 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