Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Nalimov's tablebases - memory leak

Author: Dann Corbit

Date: 16:46:39 08/05/99

Go up one level in this thread


On August 05, 1999 at 19:41:58, Eugene Nalimov wrote:

>I beleive the memory will be released by operating system.
>
>Eugene
>
>On August 05, 1999 at 19:23:16, Gerrit Reubold wrote:
>
>>Hi Eugene, hi all,
>>
>>I have successfully included Nalimov's tablebases in my program, they are
>>working great, thanks again for supplying them.
>>
>>However, I have a small problem with my implementation of Nalimov's probing
>>code, it works fine, but I get memory leaks when exiting the program. The memory
>>was allocated by "IInitializeTb(cPath)", is there a complementary function which
>>I forgot to call on exit? I am using MSVC 6.0, if it helps, I can mail or post
>>(parts of) the debug output.
>>This is not a big problem, because it happens when exiting the program, but it
>>would be nice to exit "clean".
>>
>>Has somebody the same problem? Is there a remedy?
Once you have entered the EGTB initialization functions and successfully
allocated memory, register a function that frees the memory with atexit().
Also, if you are using crafty, then register this funtion with atexit() if you
want purify/electric fence/boundschecker to pipe down:

void release (void)
{
  int i;
  free (local[0]);
  for (i = 0; i < 32; i++)
    free (args[i]);
  free (EGTB_cache);
  free (trans_ref_a_orig);
  free (trans_ref_b_orig);
  free (pawn_hash_table_orig);
}



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.