summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-19 00:21:58 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-19 00:21:58 +0000
commit6a93a7e5bbd9f0bd3bf729ac738270ae82ef9448 (patch)
tree4b60093630597983e09296bcc1e39fe8e396bcdd /hv.c
parent89e6eba15d11fe2c88c5f730266690dac444f520 (diff)
downloadperl-6a93a7e5bbd9f0bd3bf729ac738270ae82ef9448.tar.gz
Map the HE arena onto SV type 0 (SVt_NULL).
Abolish PL_he_root and PL_he_arenaroot. p4raw-id: //depot/perl@26171
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hv.c b/hv.c
index afccf85cbe..1de2e01375 100644
--- a/hv.c
+++ b/hv.c
@@ -42,11 +42,11 @@ S_more_he(pTHX)
HE* he;
HE* heend;
Newx(he, PERL_ARENA_SIZE/sizeof(HE), HE);
- HeNEXT(he) = PL_he_arenaroot;
- PL_he_arenaroot = he;
+ HeNEXT(he) = (HE*) PL_body_arenaroots[HE_SVSLOT];
+ PL_body_arenaroots[HE_SVSLOT] = he;
heend = &he[PERL_ARENA_SIZE / sizeof(HE) - 1];
- PL_he_root = ++he;
+ PL_body_roots[HE_SVSLOT] = ++he;
while (he < heend) {
HeNEXT(he) = (HE*)(he + 1);
he++;
@@ -65,11 +65,13 @@ STATIC HE*
S_new_he(pTHX)
{
HE* he;
+ void **root = &PL_body_roots[HE_SVSLOT];
+
LOCK_SV_MUTEX;
- if (!PL_he_root)
+ if (!*root)
S_more_he(aTHX);
- he = PL_he_root;
- PL_he_root = HeNEXT(he);
+ he = *root;
+ *root = HeNEXT(he);
UNLOCK_SV_MUTEX;
return he;
}
@@ -78,8 +80,8 @@ S_new_he(pTHX)
#define del_HE(p) \
STMT_START { \
LOCK_SV_MUTEX; \
- HeNEXT(p) = (HE*)PL_he_root; \
- PL_he_root = p; \
+ HeNEXT(p) = (HE*)(PL_body_roots[HE_SVSLOT]); \
+ PL_body_roots[HE_SVSLOT] = p; \
UNLOCK_SV_MUTEX; \
} STMT_END