[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: testing malloc / free behaviour
From: |
David Wetzel |
Subject: |
Re: testing malloc / free behaviour |
Date: |
Mon, 17 Dec 2007 11:01:36 +0100 |
David Ayers wrote:
> http://www.gnu.org/software/libc/manual/html_node/Freeing-after-Malloc.html#Free
> ing-after-Malloc
> [http://tinyurl.com/yqh6n4]
> "Occasionally, free can actually return memory to the operating system
> and make the process smaller. Usually, all it can do is allow a later
> call to malloc to reuse the space. In the meantime, the space remains in
> your program as part of a free-list used internally by malloc.
Which is GNU lib c. That may apply only to Linux.
On MacOS and NetBSD, the memory is given to the system.
> There is no point in freeing blocks at the end of a program, because all
> of the program's space is given back to the system when the process
> terminates. "
That should be true on any system with a decent architecture.
David