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

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

Tony Cook via RT
March 23, 2014 23:38
[perl #120939] [PATCH] refactor and fix leak in const_av_xsub
Message ID:
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.


via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About