[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] bugs report

From: bump
Subject: Re: [gnugo-devel] bugs report
Date: Fri, 11 Jul 2003 14:32:44 -0700

> Windows will reclaim the memory after the application finishes, just
> as documented above.  None-the-less, most (all?) memory check
> programs are going to point out the memory that you didn't free as
> possible memory leaks.  For this reason alone, it might be worth
> freeing the memory on application exit.

Unless there is a problem we probably don't want to make any revisions 
to the engine that are not absolutely necessary before the 3.4 release.

But what about dragon2? Pcibus wrote:

> 1.8 engine\dragon.c 746 line. leak 504 bytes. (run more times)
> dragon2 = malloc(number_of_dragons * sizeof(*dragon2));
> This bug unknown reason, free() can`t free memory.
> memory leak increase. 168,504,840 ...
> 168 = sizeof(*dragon2). 168*3 = 504. 168*5=840.
> number_of_dragons = 3 or number_of_dragons = 5.

The code in question looks like this:

  if (dragon2 != NULL)
  dragon2 = malloc(number_of_dragons * sizeof(*dragon2));

If indeed as Pcibus claims there is some reason dragon2 can't 
be deallocated, I guess this is a real example of a memory 
leak. Unlike the hash table and owl stack, malloc is called
every move on this one.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]