This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
reorder 'struct block' fields.
authorDavid Mitchell <davem@iabyn.com>
Sat, 17 Oct 2015 14:22:05 +0000 (15:22 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:18:30 +0000 (09:18 +0000)
On 64-bit builds, there was a 32-bit hole near the beginning. Shuffle this
towards the middle of the struct (just before the blk_u union).

Unfortunately this (moved) hole can't be filled by having an I32 at the
start of each union member, since struct block_eval is already the largest
and has no 32-bit fields.

Still, moving further on than some of the hotter fields can't hurt.

cop.h

diff --git a/cop.h b/cop.h
index 8527384..8408e09 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -880,11 +880,11 @@ struct block {
     I32                blku_oldsaveix; /* saved PL_savestack_ix */
     /* all the fields above must be aligned with same-sized fields as sbu */
     I32                blku_oldsp;     /* current sp floor: where nextstate pops to */
-    COP *      blku_oldcop;    /* old curcop pointer */
     I32                blku_oldmarksp; /* mark stack index */
-    I32                blku_oldscopesp;        /* scope stack index */
+    COP *      blku_oldcop;    /* old curcop pointer */
     PMOP *     blku_oldpm;     /* values of pattern match vars */
     SSize_t     blku_old_tmpsfloor;     /* saved PL_tmps_floor */
+    I32                blku_oldscopesp;        /* scope stack index */
 
     union {
        struct block_sub        blku_sub;