summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-20 19:49:50 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-20 19:49:50 +0000
commitac572bf4fde55cf563ae338dfe4e12b22ebc6d80 (patch)
treefa0c5697d540c2039ef5fdaeea4f6506ca28199b /mathoms.c
parent82c0efa4e83781652347e2d8715e3fc7441c39d4 (diff)
downloadperl-ac572bf4fde55cf563ae338dfe4e12b22ebc6d80.tar.gz
Perl_newAV() can become a mathom by making newAV() a wrapper around
newSV_type() and tweaking Perl_sv_upgrade(). p4raw-id: //depot/perl@32675
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mathoms.c b/mathoms.c
index 59ffe09d95..3caab1beff 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -66,7 +66,7 @@ PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len);
PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...);
PERL_CALLCONV int Perl_printf_nocontext(const char *format, ...);
PERL_CALLCONV int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg);
-
+PERL_CALLCONV AV * Perl_newAV(pTHX);
/* ref() is now a macro using Perl_doref;
* this version provided for binary compatibility only.
@@ -1328,6 +1328,16 @@ Perl_magic_setglob(pTHX_ SV *sv, MAGIC *mg)
return 0;
}
+AV *
+Perl_newAV(pTHX)
+{
+ return (AV*)newSV_type(SVt_PVAV);
+ /* sv_upgrade does AvREAL_only():
+ AvALLOC(av) = 0;
+ AvARRAY(av) = NULL;
+ AvMAX(av) = AvFILLp(av) = -1; */
+}
+
#endif /* NO_MATHOMS */
/*