Re: glib hash memory footprint

Soeren Sandmann <sandmann daimi au dk> writes:

> The same scheme could be used to avoid calling the equal function in
> the common case: Reserve a third pair, COLLISSION_KEY/VALUE, that
> would indicate that the entry is actually a collission site. That way
> if an entry *wasn't* a collision site, the lookup function could just
> return without calling the equal function at all.

This won't work because you have to call the equal function
anyway. The application could be looking up something that just
happens to hash to the same position without actually being equal.

I still think the other suggestions work though.


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