Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2000:
[Freeciv-Dev] Re: The implementation if freeciv ID numbers
Home

[Freeciv-Dev] Re: The implementation if freeciv ID numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: thue@xxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: The implementation if freeciv ID numbers
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 19 Mar 2000 16:37:52 +1100 (EST)

Thue Janus Kristensen wrote:

> Currently freeciv has an "unsigned char used_ids[8192];" bitvector with a bit
> per 65536 possible id number. Every time a unit or city is
> allocated/deallocated the id bit is set/reset with with alloc_id/dealloc_id.

Is this actually used though?  It looked pretty crufty to me, but I
never got around to looking at it though.  My understanding is that
the current code _doesn't_ actually re-use ids at all (despite the
above bitvector).

As you alluded, various things become a lot simpler when ids are 
never re-used (eg, no possibility of confusion between server and 
client with lag, etc), so I would suggest we go with non-reused, 
32-bit ids.

> It would of course be a problem if freeciv were compiled on a 16 bit platform
> (where an int would be 16 bit). Then the current implementation makes sence.

The current implementation assumes 32-bit ints in various places,
so I wouldn't worry.

-- David



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