summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-02-02 18:52:27 -0800
committerLarry Wall <lwall@sems.com>1996-02-02 18:52:27 -0800
commitc07a80fdfe3926b5eb0585b674aa5d1f57b32ade (patch)
tree6d56135571eb9ea6635748469bdaf72ad481247a /hv.c
parent91b7def858c29dac014df40946a128c06b3aa2ed (diff)
downloadperl-c07a80fdfe3926b5eb0585b674aa5d1f57b32ade.tar.gz
perl5.002beta3
[editor's note: no patch file was found for this release, so no fine-grained changes] I can't find the password for our ftp server, so I had to drop it into ftp://ftp.sems.com/pub/incoming/perl5.002b3.tar.gz, which is a drop directory you can't ls. The current plan is that Andy is gonna whack on this a little more, and then release a gamma in a few days when he's happy with it. So don't get carried away. This is now *late* beta. In other words, have less than the appropriate amount of fun. :-) Larry
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/hv.c b/hv.c
index 852ee165a5..d9cbe52337 100644
--- a/hv.c
+++ b/hv.c
@@ -320,7 +320,9 @@ HV *hv;
register HE **b;
register HE *entry;
register HE **oentry;
+#ifndef STRANGE_MALLOC
I32 tmp;
+#endif
a = (HE**)xhv->xhv_array;
nomemok = TRUE;
@@ -337,11 +339,9 @@ HV *hv;
assert(tmp >= newsize);
New(2,a, tmp, HE*);
Copy(xhv->xhv_array, a, oldsize, HE*);
- if (oldsize >= 64 && *(char*)&xhv->xnv_nv == 0) {
- sv_add_arena((char*)xhv->xhv_array, oldsize * sizeof(HE*), 0);
- sv_add_arena(((char*)a) + newsize * sizeof(HE*),
- newsize * sizeof(HE*) - MALLOC_OVERHEAD,
- SVf_FAKE);
+ if (oldsize >= 64 && !nice_chunk) {
+ nice_chunk = (char*)xhv->xhv_array;
+ nice_chunk_size = oldsize * sizeof(HE*) * 2 - MALLOC_OVERHEAD;
}
else
Safefree(xhv->xhv_array);
@@ -387,7 +387,6 @@ newHV()
xhv->xhv_max = 7; /* start with 8 buckets */
xhv->xhv_fill = 0;
xhv->xhv_pmroot = 0;
- *(char*)&xhv->xnv_nv = 0;
(void)hv_iterinit(hv); /* so each() will start off right */
return hv;
}
@@ -475,14 +474,7 @@ HV *hv;
return;
xhv = (XPVHV*)SvANY(hv);
hfreeentries(hv);
-#ifdef STRANGE_MALLOC
Safefree(xhv->xhv_array);
-#else
- if (xhv->xhv_max < 127 || *(char*)&xhv->xnv_nv)
- Safefree(xhv->xhv_array);
- else /* We used last half, so use first half for SV arena too. */
- sv_add_arena((char*)xhv->xhv_array, (xhv->xhv_max + 1) * sizeof(HE*),0);
-#endif
if (HvNAME(hv)) {
Safefree(HvNAME(hv));
HvNAME(hv) = 0;
@@ -491,7 +483,6 @@ HV *hv;
xhv->xhv_max = 7; /* it's a normal associative array */
xhv->xhv_fill = 0;
xhv->xhv_keys = 0;
- *(char*)&xhv->xnv_nv = 1;
if (SvRMAGICAL(hv))
mg_clear((SV*)hv);