Replace locked mempools with memory contexts
Current mempools are kind of hybrid structures - they serve two purposes:
-
mempool with a lock is basically static sized allocator with pre-allocated free items
-
mempool without a lock is a doubly-linked list of preallocated items
The first kind of usage could be easily replaced with jemalloc small sized arena objects and thread-local caches.
The second usage not-so-much and we need to keep this (in libdns:message.c) for performance reasons.
Closes #2398 (closed)
Edited by Ondřej Surý