summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-10-29 11:36:26 +0000
committerSteve Peters <steve@fisharerojo.org>2005-10-29 11:36:26 +0000
commitb966a8126159ca0abbcdfaef42a884132eb8c589 (patch)
treeaa76127a8951b1479cd90c4ecbde51a5bbd14043 /mathoms.c
parent2674aeec9d4106f3928d3c8b88be7bc9e6f8eff1 (diff)
downloadperl-b966a8126159ca0abbcdfaef42a884132eb8c589.tar.gz
Coverage stats say av_fake() is a mathom too.
p4raw-id: //depot/perl@25872
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mathoms.c b/mathoms.c
index 3d9105fba1..09eb351887 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -317,6 +317,28 @@ Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv, const char *prefix)
gv_efullname4(sv, gv, prefix, TRUE);
}
+AV *
+Perl_av_fake(pTHX_ register I32 size, register SV **strp)
+{
+ register SV** ary;
+ register AV * const av = (AV*)NEWSV(9,0);
+
+ sv_upgrade((SV *)av, SVt_PVAV);
+ Newx(ary,size+1,SV*);
+ AvALLOC(av) = ary;
+ Copy(strp,ary,size,SV*);
+ AvREIFY_only(av);
+ SvPV_set(av, (char*)ary);
+ AvFILLp(av) = size - 1;
+ AvMAX(av) = size - 1;
+ while (size--) {
+ assert (*strp);
+ SvTEMP_off(*strp);
+ strp++;
+ }
+ return av;
+}
+
/*
* Local variables:
* c-indentation-style: bsd