diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-11-19 00:21:58 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-11-19 00:21:58 +0000 |
commit | 6a93a7e5bbd9f0bd3bf729ac738270ae82ef9448 (patch) | |
tree | 4b60093630597983e09296bcc1e39fe8e396bcdd /hv.c | |
parent | 89e6eba15d11fe2c88c5f730266690dac444f520 (diff) | |
download | perl-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.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |