diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-09 23:09:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-09 23:09:40 +0000 |
commit | 837485b6cd4b757519a4ac6f03f3857c2fcf4844 (patch) | |
tree | f8a5bcaa5cc60df2da6db55f7faced65ca3a55f1 /hv.c | |
parent | 565764a853a177193a027e73655fad354d57fc10 (diff) | |
parent | ef50df4b2435a16251e94335bad8aa9485e4478c (diff) | |
download | perl-837485b6cd4b757519a4ac6f03f3857c2fcf4844.tar.gz |
[asperl] integrate win32 branch contents
p4raw-id: //depot/asperl@493
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -45,7 +45,7 @@ more_he(void) { register HE* he; register HE* heend; - he_root = (HE*)safemalloc(1008); + New(54, he_root, 1008/sizeof(HE), HE); he = he_root; heend = &he[1008 / sizeof(HE) - 1]; while (he < heend) { @@ -678,6 +678,10 @@ hsplit(HV *hv) nomemok = TRUE; #ifdef STRANGE_MALLOC Renew(a, newsize, HE*); + if (!a) { + nomemok = FALSE; + return; + } #else i = newsize * sizeof(HE*); #define MALLOC_OVERHEAD 16 @@ -688,6 +692,10 @@ hsplit(HV *hv) tmp /= sizeof(HE*); assert(tmp >= newsize); New(2,a, tmp, HE*); + if (!a) { + nomemok = FALSE; + return; + } Copy(xhv->xhv_array, a, oldsize, HE*); if (oldsize >= 64) { offer_nice_chunk(xhv->xhv_array, @@ -751,6 +759,10 @@ hv_ksplit(HV *hv, IV newmax) nomemok = TRUE; #ifdef STRANGE_MALLOC Renew(a, newsize, HE*); + if (!a) { + nomemok = FALSE; + return; + } #else i = newsize * sizeof(HE*); j = MALLOC_OVERHEAD; @@ -760,6 +772,10 @@ hv_ksplit(HV *hv, IV newmax) j /= sizeof(HE*); assert(j >= newsize); New(2, a, j, HE*); + if (!a) { + nomemok = FALSE; + return; + } Copy(xhv->xhv_array, a, oldsize, HE*); if (oldsize >= 64) { offer_nice_chunk(xhv->xhv_array, |