Why is FixedBufferAllocator in std.heap?

I thought for sure this would be somewhere… but I’m not easily finding it, so I’ll run the risk of revisiting old (before-my-time) territory.

Why is FixedBufferAllocator in std.heap? (I do realize that one could create a buffer on the heap, and initialize FixedBufferAllocator with that, but so frequently FixedBufferAllocator is used for stack-based allocations, especially in examples and simple code, so….)

I might imagine an std.allocator (or std.alloc) namespace that contains all of the allocators (currently in std.heap and std.mem), but I’m guessing there’s a good reason for partitioning it the way it is?

1 Like

see this thread: Why are allocator interfaces and implementations split across `std.mem` / `std.heap`, while IO is colocated under `std.Io`?

2 Likes