Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: freeciv2 kernel,modules and rulesets
Home

[Freeciv-Dev] Re: freeciv2 kernel,modules and rulesets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andrew Sutton <ansutton@xxxxxxx>
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: freeciv2 kernel,modules and rulesets
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Dec 2001 10:38:41 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Dec 02, 2001 at 07:07:08PM -0500, Andrew Sutton wrote:
> > please read once more what i said ;-). i didn't say pointers won't be
> > member of any structure or that they don't take any place. i said you will
> > have just ONE pointer per tile for handlers, and it will point to handlers
> > table of appropriate tile type. well, s/will/would/ :-).
> 
> it should just be a concern in the mapd evelopers mind that putting too much 
> crap in a tile will cause a huge memory footprint. but i don't necessarily 
> think that just adds a level of indirection without actually reducing the 
> amount of memory per tile. tile DO have certain data that does need to be 
> applied to every tile. 

> however, units, cities, etc. the map is sparesely populated with
> that informatin.

Ack. But it is a tradeoff. Say you want to iterate through all units
at a tile:
 1) current situation: deref a pointer of the tile and go trough the
 short (<7) list; costs 4 bytes per tile
 2) proposed solution: go through all units (this can be hundreds) and
 select the units you want; costs 0 bytes per tile

We can afford these 4 bytes per tile. Max size is 200x100 ==
200*100*4=80k.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "> WHY?! Isn't it better to put $(shell cat cscope.files) on the list of
  I only have a yellow belt in makefile kungfu.  These fancy gnu make things
  are relatively new to some of us..."
    -- Mark Frazer to Vassilii Khachaturov in linux-kernel


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