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

Re: sv_grow() and malloc()

Thread Previous
Dave Mitchell
September 23, 2014 13:33
Re: sv_grow() and malloc()
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About