Add support for custom memory allocators for rculfhash
authorXenofon Foukas <fon1989@gmail.com>
Thu, 15 Feb 2024 15:21:42 +0000 (15:21 +0000)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Feb 2024 22:32:53 +0000 (17:32 -0500)
commitac7352545826996e3866c599e4a8eff05fb662ca
treec723cbbac32a08216105e502dfd7775a33342e6e
parentc6fbc27960c6ae09af830e33884a40f53a879f6b
Add support for custom memory allocators for rculfhash

The current implementation of rculfhash relies on calloc()
to allocate memory for its buckets. This can in some cases
lead to latency spikes when accessing the hash table, which
can be avoided by using an optimized custom memory allocator.
However, there is currently no way of replacing the default
allocator with a custom one.

This commit allows custom allocators to be used during the
table initialization. The default behavior of the hash table
remains unaffected, by using the stdlib calloc() and free(),
if no custom allocator is given.

Signed-off-by: Xenofon Foukas <fon1989@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Id9a405e5dc42e5564ff8623394c86056a4d1ff48
include/urcu/rculfhash.h
src/rculfhash-internal.h
src/rculfhash-mm-chunk.c
src/rculfhash-mm-mmap.c
src/rculfhash-mm-order.c
src/rculfhash.c
This page took 0.025911 seconds and 4 git commands to generate.