in reply to Re^5: perl5.10 Devel::Size behaviour changed? (bug report)
in thread perl5.10 Devel::Size behaviour changed?
I see you removed the "rvalue" reference...
Anyway, the code of D::S does this:
if (AvMAX(thing) != -1) { /* an array with 10 slots has AvMax() set to 9 - te 2007-04-22 * +/ total_size += sizeof(SV *) * (AvMAX(thing) + 1);
And AvMAX is defined as:
#define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max
Ie. It simply gets the value from a struct member.
It also references AvALLOC & AvARYLEN, but neither of those does anything with magic either:
#define AvARRAY(av) ((av)->sv_u.svu_array) #define AvALLOC(av) (*((SV***)&((XPVAV*) SvANY(av))->xav_alloc)) #define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max #define AvFILLp(av) ((XPVAV*) SvANY(av))->xav_fill #define AvARYLEN(av) (*Perl_av_arylen_p(aTHX_ MUTABLE_AV(av)))
The only "method" that touches magic is AvFILL:
#define AvFILL(av) ((SvRMAGICAL((const SV *) (av))) \ ? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
And AvFILL doesn't appear anywhere in the D::S source.
So, I say again, the bug does not lie with D::S.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: perl5.10 Devel::Size behaviour changed? (bug report)
by ikegami (Patriarch) on Sep 04, 2009 at 20:07 UTC |