rculfhash: power power of two check should allow 0
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 3 Sep 2011 18:33:06 +0000 (14:33 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 3 Sep 2011 18:33:06 +0000 (14:33 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 807a22d177ed85b6d853dbfe71757342104e33a5..174c11cf7babb4a35a7d533b3dd557ab221ae3dc 100644 (file)
@@ -622,7 +622,7 @@ struct cds_lfht *cds_lfht_new(cds_lfht_hash_fct hash_fct,
        unsigned long order;
 
        /* init_size must be power of two */
-       if (init_size & (init_size - 1))
+       if (init_size && (init_size & (init_size - 1)))
                return NULL;
        ht = calloc(1, sizeof(struct cds_lfht));
        ht->hash_fct = hash_fct;
This page took 0.026102 seconds and 4 git commands to generate.