summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-07-04 04:15:59 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-07-04 04:15:59 +0000
commit612f20c37ac59506501c890e7f9285f551c793d2 (patch)
tree0a5b7c0359483a9ec5cf29ce04f10c0614f5ab88 /hv.c
parentcf36064f875775fbd01f4387ab083483e8fa24f8 (diff)
downloadperl-612f20c37ac59506501c890e7f9285f551c793d2.tar.gz
fix large memory leak that has been around for ever, masked by
-DPURIFY (most of the arenas were never freed!) p4raw-id: //depot/perl@6298
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index 44d37e34d3..6a07615ec3 100644
--- a/hv.c
+++ b/hv.c
@@ -42,9 +42,14 @@ S_more_he(pTHX)
{
register HE* he;
register HE* heend;
- New(54, PL_he_root, 1008/sizeof(HE), HE);
- he = PL_he_root;
+ XPV *ptr;
+ New(54, ptr, 1008/sizeof(XPV), XPV);
+ ptr->xpv_pv = (char*)PL_he_arenaroot;
+ PL_he_arenaroot = ptr;
+
+ he = (HE*)ptr;
heend = &he[1008 / sizeof(HE) - 1];
+ PL_he_root = ++he;
while (he < heend) {
HeNEXT(he) = (HE*)(he + 1);
he++;