develooper Front page | perl.perl5.porters | Postings from March 2001

Re: [PATCH] av.h cosmetics

Thread Previous | Thread Next
Simon Cozens
March 31, 2001 04:13
Re: [PATCH] av.h cosmetics
Message ID:
On Fri, Mar 30, 2001 at 12:20:57PM -0600, Jarkko Hietaniemi wrote:
> > Should the AvALLOC vs. AvARRAY offset hack be documented?
> Yes.

--- /home/simon/patchbay/perl/pod/perlguts.pod~	Sat Mar 31 13:06:38 2001
+++ /home/simon/patchbay/perl/pod/perlguts.pod	Sat Mar 31 13:08:02 2001
@@ -247,6 +247,15 @@
 shown in parentheses, and the values of C<SvCUR> and C<SvLEN> reflect
 the fake beginning, not the real one.
+Something similar to the offset hack is perfomed on AVs to enable
+efficient shifting and splicing off the beginning of the array; while
+C<AvARRAY> points to the first element in the array that is visible from
+Perl, C<AvALLOC> points to the real start of the C array. These are
+usually the same, but a C<shift> operation can be carried out by
+increasing C<AvARRAY> by one and decreasing C<AvFILL> and C<AvLEN>.
+Again, the location of the real start of the C array only comes into
+play when freeing the array. See C<av_shift> in F<av.c>.
 =head2 What's Really Stored in an SV?
 Recall that the usual method of determining the type of scalar you have is

Given an infinite amount of monkeys, an infinite amount of time, an
infinite amount of drafting supplies, and an infinite amount of crack,
they'd come up with Downtown Chicago. --  David Jacoby, in the monastery

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About