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

Re: sv_grow() and malloc()

Thread Previous
From:
Dave Mitchell
Date:
September 23, 2014 13:33
Subject:
Re: sv_grow() and malloc()
Message ID:
20140923133338.GA5204@iabyn.com
On Tue, Sep 23, 2014 at 12:49:19PM -0000, Father Chrysostomos wrote:
> Dave Mitchell wrote:
> That code does not account for the possibility that the allocated area
> may be extended, rather than moved.  (I don't know whether malloc
> does that.)

that's what the throwaway malloc() is there for: without that, on my
system, the realloc()ed area just keeps growing. With the extra malloc, its
forced to re-allocate.

-- 
My get-up-and-go just got up and went.

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