DoxigAlpha

MemoryPoolAligned

A memory pool that can allocate objects of a single type very quickly. Use this when you need to allocate a lot of objects of the same type, because It outperforms general purpose allocators.

Source

Implementation

#
pub fn MemoryPoolAligned(comptime Item: type, comptime alignment: Alignment) type {
    if (@alignOf(Item) == comptime alignment.toByteUnits()) {
        return MemoryPoolExtra(Item, .{});
    } else {
        return MemoryPoolExtra(Item, .{ .alignment = alignment });
    }
}