If I use std.heap.MemoryPool for an object like
struct Foo {
stuff: std.ArrayListUnmanaged(usize)
}
and i pool it like this:
pool = try std.heap.MemoryPool(Foo).initPreheated(allocator, 1000);
and then later i pool.create() and pool.destroy() some foo's, and then put stuff in them like foo.stuff.ensureTotalCapacity(allocator, 1000), how do I in my deinit() iterate across the memory pool freeing memory properly:
fn deinit(self: *Self) void {
for (self.pool...) |foo| {
foo.stuff.deinit(allocator);
}
}
what does that iterator code block like?