Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Getting rid of memory leaks using Nalimov's code

Author: Robert Hyatt

Date: 11:20:35 06/05/01

Go up one level in this thread


On June 05, 2001 at 11:59:58, Daniel Clausen wrote:

>Hi
>
>On June 05, 2001 at 11:18:55, Robert Hyatt wrote:
>>
>>I'm not sure I follow here.  Once he allocates buffers, they are needed until
>>the program terminates.  It is a total waste of time to free things just before
>>you terminate as that causes the "free" stuff to be done _twice_.  Once by
>>the C library to your virtual memory address space (for the free() calls) and
>>then once by the OS to mark the entire program's physical addresses as "free"
>>when it terminates...
>
>It's considered good practice to put the toys back on the shelf after playing
>with them. [as opposed to waiting for mom to do the job]
>
>Regards,
>
>Sargon


It isn't considered a good practice by me...  unless you are going to free
things then run a while longer.  But if you are going to free and immediately
exit, it is more efficient to just exit, for the reason I already gave.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.