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)
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


No differences found
This page took 0.025173 seconds and 4 git commands to generate.