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

[perl #120939] [PATCH] refactor and fix leak in const_av_xsub

From:
Tony Cook via RT
Date:
March 23, 2014 23:38
Subject:
[perl #120939] [PATCH] refactor and fix leak in const_av_xsub
Message ID:
rt-4.0.18-5004-1395617898-1402.120939-15-0@perl.org
On Sun Mar 09 22:28:10 2014, bulk88 wrote:
> On Tue Feb 11 22:16:17 2014, tonyc wrote:
> > - avoid doing the same gimme test twice, which could confuse a reader
> 
> Now there are 2 EXTENDs which are quite fat (for C) to do, scaling, 4
> pushes, comparison, reading interp globals. My code has just 1 EXTEND
> call, which I like.

The perl implementation strikes the speed vs size balance heavily on the speed side - using macros and inline functions which produce faster but significantly larger code.

So I think adding code like:

const SSize_t stack_grow = 1 + (-(gimme_v == G_ARRAY) & avlastindex);

to save a few bytes from the extra EXTEND() expansion (while slighly slowing it down) doesn't match how perl's implementation has balanced speed vs size.

> Since you fixed the leak a while ago,

Yes, I wanted to make sure the fix at least made it into 5.20.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=120939



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