[Freeciv-Dev] Re: attrhash
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sunday, January 14, 2001, at 07:33 AM, Falk Hueffner wrote:
> I have an alternate implementation, which I think is easier. I haven't
> even tried compiling it, but it is just to demonstrate the concept...
I see potential ambiguity about what part of the code owns the memory submitted
to this version. While slightly inefficient, copying leaves no such ambiguity.
Also, it may be a benefit or convenience to have calls that behave almost like
read() and write(). These calls don't have the subkey that Raimar wanted, too.
I let my keys grow to 3 full ints because it was still easy to compare and hash
into the number of buckets. Compressing into 32 bits may result in unexpected
limits. Choosing the packing creates the limits, 4 bits of type, 12 bits
subkey, 16 bits unit? Which of these may run out in the future first? Much
safer to use two ints or more.
Of course send to server has to either be built in just before the call to the
hash.c call, or for block send, enumeration will have to be added to the
common/hash.c code.
I suggest renaming attrhash to cliattrib, to better indicate the usage and
purpose, and hide the implementation.
[insert clever signoff here]
Brian Olson http://bolson.org/
- [Freeciv-Dev] Re: attrhash,
Brian Olson <=
|
|