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

Re: Hash table implementation



On Sat, Mar 06, 2004 at 14:50:31 -0800, Zeeshan Ali wrote:
> Hello everyone,
> 
>    Does the kernel API provide a nice hash-table implementation?

Not that I know of. There are several hashes, but each is done more or
less independently. Basicaly, the hashes are always fixed-size with
external chains. That is, you simply allocate array of list_heads. Your
hash function computes index to this table and all the rest are
operations on a doubly-linked list with head as implemented by
linux/list.h

Oh, in 2.4, there was linux/ghash.h, which provided some very clever
hash implementation. It was not used at all, so it got deleted.

In 2.6, there is linux/hash.h, which provides standard hashing function
for numbers and pointers.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature