array-hash
array-hash copied to clipboard
Custom allocators
It looks like a significant % of time can be spent in malloc
and realloc
. It would be awesome to be able to pass in custom allocators to speed those up.
Hi,
Effectively, due to the nature of the data structure most time will be spend on allocations on insertion.
Currently there is no support for a custom allocator due to the fact that std::allocator_traits
has no reallocate
method. Using std::realloc
with a char
buffer allows the standard library implementation to do some potential extra optimizations.
I will see if I can add support for a custom allocator which must implement a realloc
function in addition to the traits in std::allocator_traits
.
Thibaut
That'd be great, thanks!