rculfhash: extract compare_fct and hash_fct from the hash table
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 5 Nov 2011 13:01:09 +0000 (09:01 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 5 Nov 2011 13:01:09 +0000 (09:01 -0400)
commit0422d92c2d658f6093b8209f75808efd2109a110
tree31f7f3cba3a0122233e2b2a8af0f243014dd3f20
parent5f74363e048fb82d7ad97a780eadbeb063840787
rculfhash: extract compare_fct and hash_fct from the hash table

Leave the compare_fct and hash_fct to the caller, which can therefore
become the only one which needs to know the layout of struct
cds_lfht_node (except for the _cds_lfht_node part).

This will enable us to remove the cds_lfht_node structure from the hash
table (moving it entirely to the caller), replacing it by
_cds_lfht_node, which is really the only part the hash table needs to
know about.

Use-cases that can benefit from this extra flexibility:

>> Sometimes the caller don't have the key or the keys which are big
>> are saved separated. Example: file server
>> Or key comparation is too slow.
>> Or caller just need approximate lookup.
>> Or caller want to compare keys with different strategies for
>> performance.

Suggested-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c
tests/test_urcu_hash.c
urcu/rculfhash.h
This page took 0.02616 seconds and 4 git commands to generate.