summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2004-06-07 23:09:42 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-06-08 13:44:27 +0000
commit2b573acec7886e18e5f2804e8915073100dce2e4 (patch)
tree60c48c757c95672d726a096029840f65f872f61b /av.c
parent7b614c55f5b832a2a6bef87f61ab8323c0d06c60 (diff)
downloadperl-2b573acec7886e18e5f2804e8915073100dce2e4.tar.gz
Re: [PATCH] Re: Lack of error for large string on Solaris
Message-ID: <40C4A156.5030205@iki.fi> p4raw-id: //depot/perl@22904
Diffstat (limited to 'av.c')
-rw-r--r--av.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/av.c b/av.c
index 9cae02393a..3eaeea8ecd 100644
--- a/av.c
+++ b/av.c
@@ -100,6 +100,11 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
}
}
else {
+#ifdef PERL_MALLOC_WRAP
+ static const char oom_array_extend[] =
+ "Out of memory during array extend"; /* Duplicated in pp_hot.c */
+#endif
+
if (AvALLOC(av)) {
#if !defined(STRANGE_MALLOC) && !defined(MYMALLOC)
MEM_SIZE bytes;
@@ -114,7 +119,7 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
#endif
newmax = key + AvMAX(av) / 5;
resize:
- MEM_WRAP_CHECK_1(newmax+1, SV*, "panic: array extend");
+ MEM_WRAP_CHECK_1(newmax+1, SV*, oom_array_extend);
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
Renew(AvALLOC(av),newmax+1, SV*);
#else
@@ -149,7 +154,7 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
}
else {
newmax = key < 3 ? 3 : key;
- MEM_WRAP_CHECK_1(newmax+1, SV*, "panic: array extend");
+ MEM_WRAP_CHECK_1(newmax+1, SV*, oom_array_extend);
New(2,AvALLOC(av), newmax+1, SV*);
ary = AvALLOC(av) + 1;
tmp = newmax;