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

Rusty Russell rusty at rustcorp.com.au
Fri Oct 22 11:17:09 EST 2010


Hi Joey,

   Looking at AVR it's occurred to me that hashtable and avr should have
similar interfaces.  Unfortunately, I don't like the hashtable interface
at all, so let's not copy that.

One difference between our interfaces is that you chose separate keys
and values, and I chose to assume a single object which contains both.  In
my experience that's the norm; you have an object you want to put into the
hash.  If that's true, then in the other case you could always make a
key/value object.

After some thought, I like the iterator object approach you used.  Should
find return an iterator?  Should delete take one?  Or should we have two
deletes: a "delete this object" (ie. find by pointer) and "delete by key"
(ie. lookup, then delete)?  Assuming lookup is efficient, the latter is
probably enough.

I think if we make some decisions for these two, we can get future containers
to follow suit.

Thanks!
Rusty.





More information about the ccan mailing list