develooper Front page | perl.perl5.porters | Postings from January 2008

MRO and av_clear

Thread Next
From:
Torsten Schoenfeld
Date:
January 3, 2008 16:25
Subject:
MRO and av_clear
Message ID:
1199406338.12555.14.camel@home.hcsiteeffak.de
Aloha,

I'm experiencing problems with Glib/Gtk2 and perl 5.10.0.  The issue
appears to be that changes made to @ISA arrays via XS don't seem to have
an impact on perl's idea of the hierarchy.  That is, even though we
changed @Thingy::ISA from qw(FooClass) to qw(BarClass), perl still
thinks that Thingy->isa('FooClass').  After some head-scratching it
turned out that using av_clear on @ISA prior to filling it with new
entries is the culprit.  If av_clear (isa) is replaced with

	for (i = 0; i < av_len(isa) + 1; i++) {
		SV *sv = av_pop (isa);
		sv_free (sv);
	}

everything works fine.

So, that leaves me (and #p5p) wondering if that's a bug or if it's
illegal to call av_clear on some @ISA.

We also wondered how you would go about optimizing @ISA mangling in XS
in a way similar to what seems to be done for Perl's builtins.
Specifically, dmq wondered whether there is a way "to somehow in XS
disable the whole method resolution stuff, mass modify @ISA and then
somehow force mro to do a single recalc."

-- 
Bye,
-Torsten


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About