[ccan] AVR, hashtable and general containers...

Thomas Jones thomas.jones at utoronto.ca
Fri Oct 29 11:18:50 EST 2010


   On 22/10/10 10:18 PM, Rusty Russell wrote:
>   The accepted wisdom in linked lists in C is to embed rather than 
> dissociate
> the list element.  This avoids allocations and (sometimes) maintains type
> safety.  So let's apply a congruent argument here.
>
> If our objects know they are in a container, then we should not only 
> prefer
> sets to maps, but the AVL struct should be placed into the object.  
> (Linear
> hash has the advantage that there is no per-object struct).
I've been wondering why the kernels red-black trees haven't been
converted to a ccan module (and in fact I was going to do it and
submit a patch,  but I haven't gotten around to it), now more so
since they are much like what you describe here...


More information about the ccan mailing list