- MEM_WRAP_CHECK_1(newmax+1, SV*, oom_array_extend);
-#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
- Renew(AvALLOC(av),newmax+1, SV*);
-#else
- bytes = (newmax + 1) * sizeof(SV*);
-#define MALLOC_OVERHEAD 16
- itmp = MALLOC_OVERHEAD;
- while ((MEM_SIZE)(itmp - MALLOC_OVERHEAD) < bytes)
- itmp += itmp;
- itmp -= MALLOC_OVERHEAD;
- itmp /= sizeof(SV*);
- assert(itmp > newmax);
- newmax = itmp - 1;
- assert(newmax >= AvMAX(av));
- Newx(ary, newmax+1, SV*);
- Copy(AvALLOC(av), ary, AvMAX(av)+1, SV*);
- if (AvMAX(av) > 64)
- offer_nice_chunk(AvALLOC(av), (AvMAX(av)+1) * sizeof(SV*));
- else
- Safefree(AvALLOC(av));
- AvALLOC(av) = ary;
+ {
+#ifdef PERL_MALLOC_WRAP /* Duplicated in pp_hot.c */
+ static const char oom_array_extend[] =
+ "Out of memory during array extend";