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: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: freeciv2 kernel,modules and rulesets
From: Reinier Post <rp@xxxxxxxxxx>
Date: Mon, 3 Dec 2001 02:22:47 +0100

On Mon, Dec 03, 2001 at 12:50:58AM +0100, Petr Baudis wrote:
> > > > oh... don't forget, your tile is now 160 bytes. assuming a map of only 
> > > > 32
> > > > by 32, that comes to a total of... 160 KB. and that's for a small map.
> > > > using c++, you'd lose all the function pointers (reduce to 64 bytes).
> > >
> > > uh, who says each tile will have own copy of structure with handlers?
> > 
> > pointers as members of a structure DO occupy memory consumption - even 
> > function pointers. a total of 5 ptrs, that's 4 bytes per pointer = 20. oops 
> > i 
> > was thinking bits and multiplying bytes ;) let me redo the math. 20 * 1024 
> > <- 
> > 32^2) = 20 KB for the map. so, every 32 bit field you add to the tile will 
> > jump the number by 4 K (e.g. a 6th ptr would yield 6 * 4 * 24 == 24 KB).
> 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/ :-).

You're not thinking this through.  You are reinventing the C++ class.
You'll be reinventing the rest of it (inheritance, polymorphism) before
you finish your example.

-- 
Reinier


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