X-Git-Url: http://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=src%2Frculfhash-mm-mmap.c;fp=src%2Frculfhash-mm-mmap.c;h=2b4bc421bae0d48050c1b93e942b8c303069b2ee;hp=be931e0511cd25a601183e047be0358700586bb2;hb=ac7352545826996e3866c599e4a8eff05fb662ca;hpb=c6fbc27960c6ae09af830e33884a40f53a879f6b diff --git a/src/rculfhash-mm-mmap.c b/src/rculfhash-mm-mmap.c index be931e0..2b4bc42 100644 --- a/src/rculfhash-mm-mmap.c +++ b/src/rculfhash-mm-mmap.c @@ -118,8 +118,8 @@ void cds_lfht_alloc_bucket_table(struct cds_lfht *ht, unsigned long order) if (order == 0) { if (ht->min_nr_alloc_buckets == ht->max_nr_buckets) { /* small table */ - ht->tbl_mmap = calloc(ht->max_nr_buckets, - sizeof(*ht->tbl_mmap)); + ht->tbl_mmap = ht->alloc->calloc(ht->alloc->state, + ht->max_nr_buckets, sizeof(*ht->tbl_mmap)); urcu_posix_assert(ht->tbl_mmap); return; } @@ -150,7 +150,7 @@ void cds_lfht_free_bucket_table(struct cds_lfht *ht, unsigned long order) if (order == 0) { if (ht->min_nr_alloc_buckets == ht->max_nr_buckets) { /* small table */ - poison_free(ht->tbl_mmap); + poison_free(ht->alloc, ht->tbl_mmap); return; } /* large table */ @@ -174,7 +174,7 @@ struct cds_lfht_node *bucket_at(struct cds_lfht *ht, unsigned long index) static struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, - unsigned long max_nr_buckets) + unsigned long max_nr_buckets, const struct cds_lfht_alloc *alloc) { unsigned long page_bucket_size; @@ -189,7 +189,7 @@ struct cds_lfht *alloc_cds_lfht(unsigned long min_nr_alloc_buckets, } return __default_alloc_cds_lfht( - &cds_lfht_mm_mmap, sizeof(struct cds_lfht), + &cds_lfht_mm_mmap, alloc, sizeof(struct cds_lfht), min_nr_alloc_buckets, max_nr_buckets); }