R: [AD] Allegro 5 new config routines, alpha 1

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> What about using . (dot) as the sub-key delimiter instead of 
> / (slash) ? Gosh ! I'm being Mozilla-ized ;-)

Slash seems more logical to me, but maybe I'm too unix-ified :P

> Given that sizeof(struct CONFIG_ENTRY) == 32, each table 
> weights 128kb ! Assuming the hash function works well, I 
> think a good compromise between memory footprint and look-up 
> efficiency could be 128 entries, which gives 4 kb per table.

Of course things are going to be tested first and the best compromise
will be choosen. I used 4096 as a test number... 128 seems too few
entries, I'd go for 256, possibly 1024 at least, to avoid too many
collisions. A new table is created only if there is a prior reference to
it; infact at startup not even the root table is allocated. This means
that if we do not use too many different "directories", the memory
footprint won't be that high anyway.

> Is it Unicode-safe ? Even if we switch to UTF-8 internally, 
> there are specific things to be taken care of.

Currently, not. For ease of code (yes, I'm that lazy :) I've assumed all
references to be in ascii format. Most of the times (if not always)
you'll reference config vars via constant string expressions, and since
you probably write your code in plain ascii, there won't be many
problems as I see it. Of course this is a simplicistic point of view.

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/