Re: calloc

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 30 Dec 1997 08:23:44 +0100

--MimeMultipartBoundary
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Andres Kroonmaa wrote:

> Can you guys explain me what happens when I ptr=3Dcalloc("1 chunk", "o=
f say 16MB")
> work on it, then free(). process SIZE does not drop after free().=20

Yes, most malloc implementations never release memory back to the OS. It
will however be reused by the application in later allocations (smaller
or sometimes bigger allocations as well)

A calloc is effectively the same as
ptr=3Dmalloc(n*size);memset(ptr,0,n*size); so regardless how you balance
the n ans size values the allocation is the same.

---
Henrik Nordstr=F6m
--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:45 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:31 MST