enum testSize = 4_000; static struct Node { Node* next; int payload; } NodeAllocator!(Node.sizeof, 2048) nodeAllocator; Node*[testSize] nodes; foreach (i; 0 .. testSize) nodes[i] = allocate!Node(nodeAllocator); foreach (i; 0 .. testSize) assert (nodes[i] !is null); foreach (i; 0 .. testSize) deallocate(nodeAllocator, nodes[i]);
Allocator used for allocating nodes of a fixed size.