Re: Oh man is this a bad one... (fwd)

From: Michael Buselli (mhbusell@midway.uchicago.edu)
Date: 05/09/96


On Thu, 9 May 1996, Kresimir Kukulj wrote:

> Does free() returns memory resources to system ????
> 
> Solaris, I think does not return memory resources (free them but do not return
> them). I don't know on other systems... 
> I hear that gnu-set of malloc routines have its own version of malloc
> and free that can return allocated memory.

     That's dependant on the compiler.  I believe most do not return it 
to the system, but retain it somewhere to be malloced again just in case 
it's needed.  In the original case that brought up all this discussion, 
he was dereferencing a pointer into a freed area and not getting a 
segmentation fault, so the memory was not being returned to the system in 
his case.

--
Michael Buselli
m-buselli@uchicago.edu
http://student-www.uchicago.edu/users/mhbusell/



This archive was generated by hypermail 2b30 : 12/18/00 PST