[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] bugs report
From: |
Paul Pogonyshev |
Subject: |
Re: [gnugo-devel] bugs report |
Date: |
Sat, 12 Jul 2003 01:07:17 +0000 |
User-agent: |
KMail/1.5.9 |
Dan wrote:
> Paul wrote:
> > > if (dragon2 != NULL)
> > > free(dragon2);
> > >
> > > 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.
> >
> > it works just as written: it reallocates dragon2[]. it never
> > frees the array.
>
> Why not?
>
> The call to free should be executed once every move cycle,
> so the block will be deallocated except for the very last
> dragon2 that is allocated.
sorry, i misread the report. i meant to say that the last
allocated block is never freed. but it fails to free
intermediate blocks, that's another - worse - story.
Paul
Re: [gnugo-devel] bugs report, bump, 2003/07/11