in reply to Massive memory leak (AS 810)

As Corion and Podmaster already pointed out, it seems something in the XS code. I'm no XS expert, but I can confirm that commenting out the SvREFCNT_inc(cv) statement solved the problem, as adding a SvREFCNT_dec(cv) at the end of the main loop does. Either way, the List::Util extension builds and executes correctly.
The first() function seems to have the same problem...

Looks like the CPAN RT bug is still open.

Replies are listed 'Best First'.
Re^2: Massive memory leak (AS 810)
by BrowserUk (Patriarch) on Feb 28, 2005 at 07:55 UTC

    Update: Corion provided this working link. Thanks, Corion.

    You may like to add your findings to the thread at [news://nntp.perl.org/perl.perl5.porters/98596]

    I realise that that link doesn't work. They used to, but they stopped it because apparently some people can't use newsreaders?


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.

      It looks like this bug has been fixed with List::Util 1.14_1.

      Interestingly, it was fixed by removing the call to SvREFCNT_inc(cv), and adding a LEAVESUB(cv) at the end of first() and reduce() subs. Can anyone shed some light on the reason why this works?

      https://rt.perl.org/rt3/Ticket/Display.html?id=34267
      (perl.org credentials required)

        https://rt.perl.org/rt3/Ticket/Display.html?id=34267 (perl.org credentials required)

        Username "guest" and password "guest" will allow anyone to look at but not touch a bug report on rt.perl.org.