diff options
author | David Mitchell <davem@iabyn.com> | 2017-07-12 14:07:16 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-07-27 11:30:22 +0100 |
commit | 7c123f9da96361fa49e1d9227644d5ee5af4cd0d (patch) | |
tree | 50c618f2b8ff777ee2d919e6970ffa5700a8d931 /makedef.pl | |
parent | 56c6304063762154ca57e85c0fe6f60069dacd77 (diff) | |
download | perl-7c123f9da96361fa49e1d9227644d5ee5af4cd0d.tar.gz |
Make immortal SVs contiguous
Ensure that PL_sv_yes, PL_sv_undef, PL_sv_no and PL_sv_zero are allocated
adjacently in memory.
This allows the SvIMMORTAL() test to be more efficient, and will (in the
next commit) allow SvTRUE() to be more efficient.
In MULTIPLICITY builds the constraint is already met by virtue of them
being adjacent items in the interpreter struct. For non-MULTIPLICITY
builds, they were just 4 global vars with no guarantees of where
they would be allocated. For this case, PL_sv_undef are deleted
as global vars and replaced with a new global var PL_sv_immortals[4],
with
#define PL_sv_yes (PL_sv_immortals[0])
etc in their place.
Diffstat (limited to 'makedef.pl')
-rw-r--r-- | makedef.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/makedef.pl b/makedef.pl index 9761954079..6e9ea5f0fb 100644 --- a/makedef.pl +++ b/makedef.pl @@ -482,6 +482,10 @@ unless ($define{'MULTIPLICITY'}) { ++$skip{$_} foreach qw( PL_interp_size PL_interp_size_5_18_0 + PL_sv_yes + PL_sv_undef + PL_sv_no + PL_sv_zero ); } |