A custom allocator can improve performance, increase memory utilization efficiency, and address the issue of frequent, small memory allocations.
Antecedent Recently, I’ve been working on the development of network data packets, requiring frequent allocation and release of small blocks of memory. Initially, I considered using a memory pool, reviewing several existing ones and discovering this: https://github.com/cacay/MemoryPool When looking at the interface, I was quite puzzled by how the memory pool’s implementation was a bit strange.