You can explicitly grow the arena when creating by using alloc(u8, 4096); free
I agree that it should come in the std.
slightly optimized version of the above: zml/stdx/stdx.zig at 8fcff8c462070d06056f8a85ba0c8a81f0f3a636 · zml/zml · GitHub
pub fn arenaWithCapacity(parent: std.mem.Allocator, initial_capacity: usize) std.mem.Allocator.Error!std.heap.ArenaAllocator {
var a: std.heap.ArenaAllocator = .init(parent);
_ = try a.allocator().alloc(u8, initial_capacity);
std.debug.assert(a.state.used_list.?.end_index == initial_capacity);
a.state.used_list.?.end_index = 0;
return a;
}