pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self
Initialize with capacity to hold num elements. The resulting capacity will equal num exactly. Deinitialize with deinit or use toOwnedSlice.
num
deinit
toOwnedSlice
gpa: Allocator
num: usize
59 60 61 62 63
pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self { var self = Self.init(gpa); try self.ensureTotalCapacityPrecise(num); return self; }
Initialize with capacity to hold
numelements. The resulting capacity will equalnumexactly. Deinitialize withdeinitor usetoOwnedSlice.