From: Mathieu Desnoyers Date: Wed, 29 Aug 2012 05:17:15 +0000 (-0700) Subject: rcuja: allow non-power of 2 keys X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1216b3d282b4b3cb4a515dee30997fd2dc078776;p=urcu.git rcuja: allow non-power of 2 keys Signed-off-by: Mathieu Desnoyers --- diff --git a/rcuja/rcuja.c b/rcuja/rcuja.c index 407c101..db5072a 100644 --- a/rcuja/rcuja.c +++ b/rcuja/rcuja.c @@ -1422,13 +1422,13 @@ struct cds_ja *_cds_ja_new(unsigned int key_bits, switch (key_bits) { case 8: - ja->key_max = UINT8_MAX; - break; case 16: - ja->key_max = UINT16_MAX; - break; + case 24: case 32: - ja->key_max = UINT32_MAX; + case 40: + case 48: + case 56: + ja->key_max = (1ULL << key_bits) - 1; break; case 64: ja->key_max = UINT64_MAX;