Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#9918) create a pleced map and rename map_temperatu
Home

[Freeciv-Dev] Re: (PR#9918) create a pleced map and rename map_temperatu

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9918) create a pleced map and rename map_temperature has map_lattitude
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 4 Sep 2004 09:33:25 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9918 >

Marcelo Burda wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9918 >
> 
> Le ven 03/09/2004 à 20:50, Jason Short a écrit :
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=9918 >
> 
> ...
> 
>>also there's no need for a remove_placed_map.  Rename create_placed_map
>>as init_place_map and use realloc instead of malloc in it.
> 
> 
> mmm i not understand why, at end of usage of pmap i has to free these
> allocated ram, i need a call to free, then realloc is useless has it
> only will work if i forget to call free before (what is a bug)
> when i use more than one time pmap.
> if i allocat pmap only one time for all generator code, i not need at
> all realloc.
> 
> as you saying i has to never free this!

That's what I was saying.  Note you'd still need the realloc because 
multiple games may be played on one server.

However I think because pmap is used in multiple places, you're right. 
It is safer to malloc and free it each time.  That way if there's 
overlap between any of the users we'll get a segfault.

jason




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