develooper Front page | perl.perl5.porters | Postings from November 2009

Re: [perl #67838] lvalue substr keeping lexical alive

Thread Previous | Thread Next
From:
Eric Brine
Date:
November 10, 2009 12:56
Subject:
Re: [perl #67838] lvalue substr keeping lexical alive
Message ID:
f86994700911101256v2cd96cd2r3ea83e0d3b57690e@mail.gmail.com
On Thu, Jul 23, 2009 at 7:19 PM, Kevin Ryde <perlbug-followup@perl.org>wrote:

> # New Ticket Created by  Kevin Ryde
> # Please include the string:  [perl #67838]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67838 >
>

What's the impact of the bug?

substr, pos and vec operate on strings. Delaying the freeing of strings has
next to no impact. Problems can occur if the scalar containing the string is
then repurposed (e.g. to hold an object with a destructor), but the odds of
this occurring is probably next to nil.

keys operate on hashes. Delaying the freeing of a hash could have a
significant impact. On the other hand, lvalue keys is probably almost never
used.


What's the impact of the fix?

Small slowdown due to the creation of a new SV for every lvalue call to
these ops


Our options at this time:

- Apply the provided patch, even though it will cause returning
substr/pos/vec/keys from an lvalue sub croaks.
- Apply an adjusted patch that doesn't fix the leak when substr/pos/vec/keys
are returned from an lvalue sub.
- Don't fix until a better solution is found.
- WONTFIX

Thread Previous | 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