summaryrefslogtreecommitdiff
path: root/embedvar.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-12 14:07:16 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:22 +0100
commit7c123f9da96361fa49e1d9227644d5ee5af4cd0d (patch)
tree50c618f2b8ff777ee2d919e6970ffa5700a8d931 /embedvar.h
parent56c6304063762154ca57e85c0fe6f60069dacd77 (diff)
downloadperl-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 'embedvar.h')
-rw-r--r--embedvar.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/embedvar.h b/embedvar.h
index 4b945f26ab..7d284b894b 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -317,6 +317,7 @@
#define PL_sv_arenaroot (vTHX->Isv_arenaroot)
#define PL_sv_consts (vTHX->Isv_consts)
#define PL_sv_count (vTHX->Isv_count)
+#define PL_sv_immortals (vTHX->Isv_immortals)
#define PL_sv_no (vTHX->Isv_no)
#define PL_sv_root (vTHX->Isv_root)
#define PL_sv_serial (vTHX->Isv_serial)