develooper Front page | perl.perl5.porters | Postings from July 2010

Re: TPF bug-grant report #18

Thread Previous | Thread Next
Nicholas Clark
July 15, 2010 02:59
Re: TPF bug-grant report #18
Message ID:
On Wed, Jul 14, 2010 at 11:30:45PM +0100, Dave Mitchell wrote:
> On Mon, Jul 12, 2010 at 10:43:24AM +0100, Dave Mitchell wrote:
> > On Mon, Jul 12, 2010 at 10:20:28AM +0100, Nicholas Clark wrote:
> > > On Mon, Jul 12, 2010 at 10:17:00AM +0100, Dave Mitchell wrote:
> > > > Continued to work on the CvSTASH/GvSTASH/CvGV/EGP weak backrefs and
> > > > general dangling pointers mess. Should hopefully start seeing some pushed
> I've now pushed my work so far, to get it some smoky love.
> The basic fixes are all in place: all of GvSTASH, SvSTASH and CvGV are now
> always correctly handled (as far as I'm aware). There's one slight issue
> with EGV still, and I have a number of bits of cleanup, optimisation and
> documentation still to do.


Definitely some level of optimisation desirable, as the correctness for
CvGV() currently comes at the price of a MAGIC structure and an AV per
subroutine in the symbol table.

In theory that could all be abolished and replaced by a flag bit, as the GP of
the GV that CvGV() points to is already pointing back to the PVCV ("we first
thought of"). Except that that then relies on anyone assigning to CvGV()
knowing to "do the right thing", which I believe now is cvgv_set(). But that
can be enforced by changing

#define CvGV(sv)	((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv


#define CvGV(sv)	(((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv + 0)

providing appropriate CvGV_set() macros in blead and ppport.h, and offering
patches to whatever CPAN code needs updating as a result.

Nicholas Clark

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