Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)
Home

[Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 May 2002 08:54:50 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, May 15, 2002 at 03:57:34PM -0500, Mike Kaufman wrote:
> On Wed, May 15, 2002 at 10:28:00PM +0200, Raimar Falke wrote:
> > On Wed, May 15, 2002 at 03:17:45PM -0500, Mike Kaufman wrote:
> > > On Wed, May 15, 2002 at 10:09:45PM +0200, Raimar Falke wrote:
> > > > On Sat, May 11, 2002 at 12:59:15AM -0500, Mike Kaufman wrote:
> > > > > we already have a [smaller] memory leak when diconnecting and
> > > > > reconnecting to the server (or quitting the server and restarting it).
> > > > > this "fix" really intensifies the memory leak---depending on the
> > > > > savegame size---by about an order of magnitude.
> > > > 
> > > > Here is a second fix. There are no additional memory leaks by calling
> > > > game_init.
> > > 
> > > how about just changing _init to do an unlink_all first instead of 
> > > creating
> > > a new (redundant) call for _reinit? 
> > 
> > This may cover other bugs. Although I have no idea how much remote
> > this is.
> 
> Possibly, but if we were recalling _init anywhere _and_ it was causing a
> problem,  we would have known about it before now.

The only scenario I can think about goes like this:
   code calls the old init on a list
     but this is a bug since the list contains elements which have to
     be freed. (so far the new init would be better) however the
     elements contain extra resources (memory, sockets,...) which
     aren't freed by the unlink_all operation. So we have a small
     resource leak which even at inspection doesn't turn up: "no it
     can't be this init calls since it takes care of the freeing the
     elements".

So I agree that the new init will only do little problems (if any).

New patch attached.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Real Users find the one combination of bizarre
   input values that shuts down the system for days."

Attachment: reinit2.diff
Description: Text document


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