[<prev] [next>] [<thread-prev] [thread-next>] [month] [year] [list]
Date: Sat, 22 Mar 2003 20:42:31 +0300
From: Solar Designer <solar@...nwall.com>
To: popa3d-users@...ts.openwall.com
Subject: Re: Possible memory leak?
On Sat, Mar 22, 2003 at 10:25:40PM +0500, Boris Kovalenko wrote:
> May be I'm wrong but all memory allocated by xalloc functions should be
> freed before the process exit to prevent memory leak.
Yes, you're wrong.
It's pieces of the process' address space which are allocated by these
functions (actual memory behind them is generally allocated on the
first write operation, but this is implementation-specific). When the
process exits, its address space no longer exists and any memory which
the kernel could have allocated to it is freed automagically.
Moreover, free(3) in most cases doesn't deallocate actual memory the
kernel could have allocated, it merely marks pieces of address space
as free for subsequent allocation by the same process.
> May be this requirement has no need with new libraries?
There has never been such a requirement.
--
/sd
Hosted by DataForce ISP -
Powered by Openwall GNU/*/Linux