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

Re: my purify runs with 5.6.1-to-be

Thread Previous | Thread Next
Gurusamy Sarathy
March 16, 2001 15:44
Re: my purify runs with 5.6.1-to-be
Message ID:
On Sat, 17 Mar 2001 01:09:42 +0200, Radu Greab wrote:
>On Fri, 16 Mar 2001 15:03 -0800, Gurusamy Sarathy wrote:
> > However, it does seem to have the problem that HvPMROOT is not
> > invalidated correctly if the head of the chain goes away.
>So we still need to have in PMOP a pointer to the stash :-(

Not if you allocate a fake PMOP and make HvPMROOT always point to the
fake one.  When a stash goes away, it takes the fake PMOP with it,
and sets the next PMOPs prev pointer to NULL.  It is kinda wasteful
of memory, but I think it will work.

I think you could avoid the memory wastefullness by playing offsetof()
tricks that make the HV* "look" like a PMOP by making the prev pointer
of the head of the chain point into the PMOP* spot of the stash
structure.  You'll then need to make sure you NULL the xhv_pmroot's
prev pointer when the stash goes away.  (All this is going to confuse
tools like purify no end, of course. :)

That said, I still don't understand the _reason_ why my approach
(with the stash refcounting added) fails in some places.  There is
some sort of memory corruption going on here and we need to find it.


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