pub fn shrinkAndFree(self: *Self, gpa: Allocator, new_len: usize) void 1008
1009
1010
1011
1012 pub fn shrinkAndFree(self: *Self, gpa: Allocator, new_len: usize) void {
if (@sizeOf(ByIndexContext) != 0)
@compileError("Cannot infer context " ++ @typeName(Context) ++ ", call shrinkAndFreeContext instead.");
return self.shrinkAndFreeContext(gpa, new_len, undefined);
}
Shrinks the underlying
Entryarray tonew_lenelements and discards any associated index entries. Reduces allocated capacity.Asserts the discarded entries remain initialized and capable of performing hash and equality checks. It is a bug to call this function if the discarded entries require deinitialization. For that use case,
shrinkRetainingCapacitycan be used instead.