/* av.c
*
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, by Larry Wall and others
+ * 2000, 2001, 2002, 2003, 2004, 2005 by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
Perl_av_make(pTHX_ register I32 size, register SV **strp)
{
register AV *av;
- register I32 i;
- register SV** ary;
av = (AV*)NEWSV(8,0);
sv_upgrade((SV *) av,SVt_PVAV);
AvFLAGS(av) = AVf_REAL;
if (size) { /* `defined' was returning undef for size==0 anyway. */
+ register SV** ary;
+ register I32 i;
New(4,ary,size,SV*);
AvALLOC(av) = ary;
SvPVX(av) = (char*)ary;
Perl_av_clear(pTHX_ register AV *av)
{
register I32 key;
- SV** ary;
#ifdef DEBUGGING
if (SvREFCNT(av) == 0 && ckWARN_d(WARN_DEBUGGING)) {
return;
if (AvREAL(av)) {
- ary = AvARRAY(av);
+ SV** ary = AvARRAY(av);
key = AvFILLp(av) + 1;
while (key) {
SV * sv = ary[--key];