Zig's MemoryPool Allocator

from blog openmymind.net, | ↗ original
You're probably familiar with Zig's GeneralPurposeAllocator, ArenaAllocator and FixedBufferAllocator, but Zig's standard library has another allocator you should be keeping at the ready: std.heap.MemoryPool. What makes the MemoryPool allocator special is that it can only create one type. As compensation for this limitation, it's very fast when...