Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: [Patch] Unify the deallocation of memory
Home

[Freeciv-Dev] Re: [Patch] Unify the deallocation of memory

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Unify the deallocation of memory
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jun 2002 21:46:17 +0200

On Thu, May 23, 2002 at 09:18:05PM +0200, Raimar Falke wrote:
> 
> The attached patch adds/renames functions:
>  foo_free(id or pointer)   // if appropriate
>  foo_alloc(int num)        // if appropriate
>  foos_free(void)
> 
> The last two will also use/set the appropriate "game." field.
> 
> These changes have an impact on client/packhand.c which now frees all
> the data which will be received later in one call of ruleset_data_free
> instead of being scattered through the code.
> 
> Also server/ruleset.c has been updated to use the new _alloc
> functions. The ruleset free patch from Per is a by-product of this
> patch.
> 
> These changes also allow the new game_free function which is now the
> top level function to free all memory.
> 
> I know that the patch isn't this small. However we have three memory
> leak related bug reports. Also note that I found at least one other
> memory leak: ptile->units wasn't unlinked.

New version attached:
 - one bug fixed
 - really fixed the obsolete bug (see improvement_status_init changes)

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Premature optimization is the root of all evil."
    -- D. E. Knuth in "Structured Programming with go to Statements"

Attachment: free3.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: [Patch] Unify the deallocation of memory, Raimar Falke <=