#define dbg_printf(args...)
#endif
-#define CHAIN_LEN_TARGET 1
-#define CHAIN_LEN_RESIZE_THRESHOLD 2
+#define CHAIN_LEN_TARGET 4
+#define CHAIN_LEN_RESIZE_THRESHOLD 8
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
chain_len);
if (chain_len >= CHAIN_LEN_RESIZE_THRESHOLD)
ht_resize_lazy(ht, t,
- get_count_order_u32(chain_len - CHAIN_LEN_TARGET + 1));
+ get_count_order_u32(chain_len - (CHAIN_LEN_TARGET - 1)));
}
static
if (old_size == new_size)
return;
new_order = get_count_order_ulong(new_size) + 1;
- dbg_printf("rculfhash: resize from %lu (order %lu) to %lu (order %lu) buckets\n",
- old_size, old_order, new_size, new_order);
+ printf("rculfhash: resize from %lu (order %lu) to %lu (order %lu) buckets\n",
+ old_size, old_order, new_size, new_order);
new_t = malloc(sizeof(struct rcu_table)
+ (new_order * sizeof(struct _rcu_ht_node *)));
assert(new_size > old_size);