Function ensureCapacity [src]
Ensures an Managed has enough space allocated for capacity limbs. If the Managed does not have
sufficient capacity, the exact amount will be allocated. This occurs even if the requested
capacity is only greater than the current capacity by one limb.
Prototype
pub fn ensureCapacity(self: *Managed, capacity: usize) !void
Parameters
self: *Managed
capacity: usize
Source
pub fn ensureCapacity(self: *Managed, capacity: usize) !void {
if (capacity <= self.limbs.len) {
return;
}
self.limbs = try self.allocator.realloc(self.limbs, capacity);
}