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

[perl #24237] @& doesn't set PL_sawampersand

Thread Previous
From:
Father Chrysostomos via RT
Date:
January 12, 2012 08:33
Subject:
[perl #24237] @& doesn't set PL_sawampersand
Message ID:
rt-3.6.HEAD-14510-1326386027-1958.24237-15-0@perl.org
On Thu Jan 12 04:06:55 2012, demerphq wrote:
> On 11 January 2012 17:36, Father Chrysostomos via RT
> <perlbug-followup@perl.org> wrote:
> > And BTW, I’d like to get rid of this PL_sawampersand madness (thereby
> > closing about 6 RT tickets), but my first attempt failed, and my second
> > attempt is awaiting a response from Nicholas Clark on the status of
> > PERL_OLD_COPY_ON_WRITE.
> 
> Should I have a look?

If you could, that would be nice, but I was specifically asking the
reasoning behind this comment in sv.c: ‘it's somewhat dead code, never
expected to go live’.

The code looks fine to me, but having someone else disprove that would
be good. :-)

> 
> Also if you are looking into this stuff also keep in mind that scalar
> /g is still a problem, and keep in mind why my patch to fix it was
> reverted (to prevent quadratic performance degradation in while (//g)
> matches).

Because it forces a pre-match copy for every iteration.  If the
pre-match copy never actually copies, that won’t be so much of a problem.

I have a local experimental patch that forces the pre-match copy to use
the shared string table, so that only the first copy is a real copy. 
But it causes memory corruption, and I haven’t got to the bottom of it
yet.  (Probably a stupid mistake somewhere.)

I wasn’t sure whether it was worth debugging my patch, considering that
PERL_OLD_COPY_ON_WRITE can already do what it does, and probably more
efficiently.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org:443/rt3/Ticket/Display.html?id=24237

Thread Previous


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