pub fn initCapacity(allocator: Allocator, capacity: usize) error allocator: Allocatorcapacity: usize2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676 pub fn initCapacity(allocator: Allocator, capacity: usize) error{OutOfMemory}!Allocating {
return .{
.allocator = allocator,
.writer = .{
.buffer = if (capacity == 0)
&.{}
else
(allocator.rawAlloc(capacity, .of(u8), @returnAddress()) orelse
return error.OutOfMemory)[0..capacity],
.vtable = &vtable,
},
.alignment = .of(u8),
};
}