diff options
-rw-r--r-- | hv.c | 8 | ||||
-rw-r--r-- | intrpvar.h | 4 | ||||
-rw-r--r-- | sv.c | 26 |
3 files changed, 21 insertions, 17 deletions
@@ -60,12 +60,10 @@ S_more_he(pTHX) { register HE* he; register HE* heend; - XPV *ptr; - New(54, ptr, PERL_ARENA_SIZE/sizeof(XPV), XPV); - ptr->xpv_pv = (char*)PL_he_arenaroot; - PL_he_arenaroot = ptr; + New(54, he, PERL_ARENA_SIZE/sizeof(HE), HE); + HeNEXT(he) = PL_he_arenaroot; + PL_he_arenaroot = he; - he = (HE*)ptr; heend = &he[PERL_ARENA_SIZE / sizeof(HE) - 1]; PL_he_root = ++he; while (he < heend) { diff --git a/intrpvar.h b/intrpvar.h index 2125acf180..9688541a14 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -437,8 +437,8 @@ PERLVAR(Ixpvhv_arenaroot,XPVHV*) /* list of allocated xpvhv areas */ PERLVAR(Ixpvmg_arenaroot,XPVMG*) /* list of allocated xpvmg areas */ PERLVAR(Ixpvlv_arenaroot,XPVLV*) /* list of allocated xpvlv areas */ PERLVAR(Ixpvbm_arenaroot,XPVBM*) /* list of allocated xpvbm areas */ -PERLVAR(Ihe_arenaroot, XPV*) /* list of allocated he areas */ -PERLVAR(Ipte_arenaroot, XPV*) /* list of allocated he areas */ +PERLVAR(Ihe_arenaroot, HE *) /* list of allocated he areas */ +PERLVAR(Ipte_arenaroot, struct ptr_tbl_ent *) /* list of allocated he areas */ /* 5.6.0 stopped here */ @@ -614,16 +614,24 @@ Perl_sv_free_arenas(pTHX) PL_xpvbm_arenaroot = 0; PL_xpvbm_root = 0; - for (arena = (XPV*)PL_he_arenaroot; arena; arena = arenanext) { - arenanext = (XPV*)arena->xpv_pv; - Safefree(arena); + { + HE *he; + HE *he_next; + for (he = PL_he_arenaroot; he; he = he_next) { + he_next = HeNEXT(he); + Safefree(he); + } } PL_he_arenaroot = 0; PL_he_root = 0; - for (arena = (XPV*)PL_pte_arenaroot; arena; arena = arenanext) { - arenanext = (XPV*)arena->xpv_pv; - Safefree(arena); + { + struct ptr_tbl_ent *pte; + struct ptr_tbl_ent *pte_next; + for (pte = PL_pte_arenaroot; pte; pte = pte_next) { + pte_next = pte->next; + Safefree(pte); + } } PL_pte_arenaroot = 0; PL_pte_root = 0; @@ -10426,12 +10434,10 @@ S_more_pte(pTHX) { register struct ptr_tbl_ent* pte; register struct ptr_tbl_ent* pteend; - XPV *ptr; - New(54, ptr, PERL_ARENA_SIZE/sizeof(XPV), XPV); - ptr->xpv_pv = (char*)PL_pte_arenaroot; + New(0, ptr, PERL_ARENA_SIZE/sizeof(struct ptr_tbl_ent), struct ptr_tbl_ent); + ptr->next = PL_pte_arenaroot; PL_pte_arenaroot = ptr; - pte = (struct ptr_tbl_ent*)ptr; pteend = &pte[PERL_ARENA_SIZE / sizeof(struct ptr_tbl_ent) - 1]; PL_pte_root = ++pte; while (pte < pteend) { |