hash table comment fix.
[urcu.git] / urcu-ht.h
index 0cbd1e648799171be694865895e0d712fa29721d..baf144d9086a872aa7f44ccfbaf6a147c73d3f9d 100644 (file)
--- a/urcu-ht.h
+++ b/urcu-ht.h
@@ -1,14 +1,26 @@
 #ifndef _URCU_HT_H
 #define _URCU_HT_H
 
-#define HASH_SIZE      4096
-typedef unsigned long (*ht_hash_fct)(void *key);
+#include <stdint.h>
 
-struct rcu_ht *ht_new(ht_hash_fct hash_fct, void (*free_fct)(void *data));
+/*
+ * Caution !
+ * Ensure writer threads are registered as urcu readers and with urcu-defer.
+ * Ensure reader threads are registered as urcu readers.
+ */
 
-void ht_delete_all(struct rcu_ht *ht);
+typedef uint32_t (*ht_hash_fct)(void *key, uint32_t length, uint32_t initval);
 
-void ht_destroy(struct rcu_ht *ht);
+/*
+ * init_size must be power of two.
+ */
+struct rcu_ht *ht_new(ht_hash_fct hash_fct, void (*free_fct)(void *data),
+                     unsigned long init_size, uint32_t keylen,
+                     uint32_t hashseed);
+
+int ht_delete_all(struct rcu_ht *ht);
+
+int ht_destroy(struct rcu_ht *ht);
 
 void *ht_lookup(struct rcu_ht *ht, void *key);
 
@@ -18,6 +30,8 @@ int ht_delete(struct rcu_ht *ht, void *key);
 
 void *ht_steal(struct rcu_ht *ht, void *key);
 
-unsigned long stupid_hash(void *key);
+void ht_resize(struct rcu_ht *ht, int growth);
+
+uint32_t ht_jhash(void *key, uint32_t length, uint32_t initval);
 
 #endif /* _URCU_HT_H */
This page took 0.022588 seconds and 4 git commands to generate.