Re: Hashtrees a bit unflexible

Andreas Rottmann <[email protected]> Wed, 17 Mar 2004 17:31:17 +0100
Newsgroups gmane.lisp.scheme.pika.devel
Message-ID <[email protected]>
Tom Lord <lord-1tv/[email protected]> writes:

> The memchunk is constant throughout the tree, right?   In other words,
> all of the keys and values in a given table use the same memchunk?
>
> I would usually solve that by using a different `struct
> hashtree_rules' for each memchunk.   Something like:
>
>
> 	struct my_hashtree_rules
>         {
>           struct hashtree_rules rules;
>
>           t_memchunk chunk;
>         };
>
>
> In the free_fn, you'll get the address of the `rules' field of one of
> these --- and you can cast that back to being the address of a `struct
> my_hashtree_rules'.
>
> Hashtree is _lower_level_ than the glib hash tables -- but that's on
> purpose.  It's intended to be suitable (flexible) for implementing
> more specialized tables with higher level intefaces although, yes, it
> does wind up often being used directly.
>
Ok, now that you explain it, it really makes sense; I just wanted to
clarify if extending the rules this way is the "proper" way to do it.

Thanks, Andy
-- 
Andreas Rottmann         | [email protected]      | 118634484@ICQ | [email protected]
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?