} while (0)
#endif
-#define CDS_JA_RANGE_KEY_BITS 64
-
enum cds_ja_range_type {
CDS_JA_RANGE_ALLOCATED,
CDS_JA_RANGE_FREE,
return ret;
}
-struct cds_ja *_cds_ja_range_new(const struct rcu_flavor_struct *flavor)
+struct cds_ja *_cds_ja_range_new(unsigned int key_bits,
+ const struct rcu_flavor_struct *flavor)
{
struct cds_ja_range *range;
struct cds_ja *ja;
int ret;
- ja = _cds_ja_new(CDS_JA_RANGE_KEY_BITS, flavor);
+ ja = _cds_ja_new(key_bits, flavor);
if (!ja)
return NULL;
range = range_create(0, UINT64_MAX - 1, NULL, CDS_JA_RANGE_FREE);
count_reader = malloc(sizeof(*count_reader) * nr_readers);
count_writer = malloc(sizeof(*count_writer) * nr_writers);
- printf("Allocating Judy Array for ranges\n");
- test_ja = cds_ja_range_new();
+ printf("Allocating %u-bit Judy Array for ranges\n",
+ key_bits);
+ test_ja = cds_ja_range_new(key_bits);
if (!test_ja) {
printf("Error allocating judy array.\n");
ret = -1;
int cds_ja_range_del(struct cds_ja *ja, struct cds_ja_range *range);
-struct cds_ja *_cds_ja_range_new(const struct rcu_flavor_struct *flavor);
+struct cds_ja *_cds_ja_range_new(unsigned int key_bits,
+ const struct rcu_flavor_struct *flavor);
static inline
-struct cds_ja *cds_ja_range_new(void)
+struct cds_ja *cds_ja_range_new(unsigned int key_bits)
{
- return _cds_ja_range_new(&rcu_flavor);
+ return _cds_ja_range_new(key_bits, &rcu_flavor);
}
int cds_ja_range_destroy(struct cds_ja *ja,