summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-20 21:15:57 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-20 21:15:57 +0000
commit878d132a73f5d089e821fedd49aa4835a2786d1d (patch)
tree5f489d4e731a9809ef0261bfb731eee600f3911a /av.c
parent3bdcbd26ea8ce137a02a61d6364dbbb1afb63c19 (diff)
downloadperl-878d132a73f5d089e821fedd49aa4835a2786d1d.tar.gz
Implement each @array.
Documentation needed, FIXME for proper 64 bit support of arrays longer than 2**32, re-order the new ops at the end if merging to 5.10.x. p4raw-id: //depot/perl@32680
Diffstat (limited to 'av.c')
-rw-r--r--av.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/av.c b/av.c
index 116b7aaf26..d528ffca02 100644
--- a/av.c
+++ b/av.c
@@ -945,8 +945,8 @@ Perl_av_exists(pTHX_ AV *av, I32 key)
return FALSE;
}
-SV **
-Perl_av_arylen_p(pTHX_ AV *av) {
+MAGIC *
+S_get_aux_mg(pTHX_ AV *av) {
dVAR;
MAGIC *mg;
@@ -961,9 +961,22 @@ Perl_av_arylen_p(pTHX_ AV *av) {
/* sv_magicext won't set this for us because we pass in a NULL obj */
mg->mg_flags |= MGf_REFCOUNTED;
}
+ return mg;
+}
+
+SV **
+Perl_av_arylen_p(pTHX_ AV *av) {
+ MAGIC *const mg = get_aux_mg(av);
return &(mg->mg_obj);
}
+/* This will change to returning IV ** at some point soon */
+I32 *
+Perl_av_iter_p(pTHX_ AV *av) {
+ MAGIC *const mg = get_aux_mg(av);
+ return &(mg->mg_len);
+}
+
/*
* Local variables:
* c-indentation-style: bsd