pub fn ensureUnusedCapacity(
self: *Self,
gpa: Allocator,
additional_capacity: usize,
) Oom!void 435
436
437
438
439
440
441
442
443 pub fn ensureUnusedCapacity(
self: *Self,
gpa: Allocator,
additional_capacity: usize,
) Oom!void {
if (@sizeOf(Context) != 0)
@compileError("Cannot infer context " ++ @typeName(Context) ++ ", call ensureTotalCapacityContext instead.");
return self.ensureUnusedCapacityContext(gpa, additional_capacity, undefined);
}
Increases capacity, guaranteeing that insertions up until
additional_countmore items will not cause an allocation, and therefore cannot fail.