X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=av.c;h=d0428925a702007dd2aea5f3d89591f2a8db2005;hb=b1e7e56f1e0264e9b11883bf65d50cc9648125ec;hp=086c75e56feb3c817fd152d69dc4ce4436c3f214;hpb=14befaf4eaa6e79d87aacb106e0b701e925483ee;p=p5sagit%2Fp5-mst-13.2.git diff --git a/av.c b/av.c index 086c75e..d042892 100644 --- a/av.c +++ b/av.c @@ -1,6 +1,6 @@ /* av.c * - * Copyright (c) 1991-2001, Larry Wall + * Copyright (c) 1991-2002, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -12,6 +12,10 @@ * meant that things should remain where they had set them)." --Treebeard */ +/* +=head1 Array Manipulation Functions +*/ + #include "EXTERN.h" #define PERL_IN_AV_C #include "perl.h" @@ -96,7 +100,7 @@ Perl_av_extend(pTHX_ AV *av, I32 key) } else { if (AvALLOC(av)) { -#ifndef STRANGE_MALLOC +#if !defined(STRANGE_MALLOC) && !defined(MYMALLOC) MEM_SIZE bytes; IV itmp; #endif @@ -130,7 +134,9 @@ Perl_av_extend(pTHX_ AV *av, I32 key) Safefree(AvALLOC(av)); AvALLOC(av) = ary; #endif +#if defined(MYMALLOC) && !defined(LEAKTEST) resized: +#endif ary = AvALLOC(av) + AvMAX(av) + 1; tmp = newmax - AvMAX(av); if (av == PL_curstack) { /* Oops, grew stack (via av_store()?) */ @@ -763,6 +769,7 @@ Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags) else { sv = AvARRAY(av)[key]; if (key == AvFILLp(av)) { + AvARRAY(av)[key] = &PL_sv_undef; do { AvFILLp(av)--; } while (--key >= 0 && AvARRAY(av)[key] == &PL_sv_undef);