ko1 / atdot.net wrote:
> Adding similar data structure can also increase complexity.
> At least, I like same interfaces for such similar data structures.

Right, I try to make ihash API like st (insert/update/foreach/lookup).
However, there must be some differences due to data layout changes.

e.g. delete could be implemented without a callback, so I call the new
operation "unlink" instead.  Maybe "delink" is a less ambiguous name...

> I think open addressing is better for such internal, small tables such as method table.
> It doesn't need chain buckets.
> 
> So I wanted to extend st to introduce open addressing mode.

Open addressing will probably work better for instance/local var tables
with simple ID->(VALUE|long|ID) mapping (no struct behind the data).

For larger structures like rb_method_entry/rb_const_entry, I think using
container_of-based storage is best.  Open addressing may not make sense
when using container_of, chaining was simpler and easier to match what
st already does, so I chose chaining for ihash.