pika-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pika-dev] Re: Hashtrees a bit unflexible


From: Andreas Rottmann
Subject: [Pika-dev] Re: Hashtrees a bit unflexible
Date: Wed, 17 Mar 2004 17:31:17 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Tom Lord <address@hidden> 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         | address@hidden      | address@hidden | address@hidden
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?




reply via email to

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