This commit is contained in:
Ilia Choly 2024-11-21 08:51:35 +01:00 committed by GitHub
commit 43b11ccbee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -301,8 +301,9 @@ pub fn reallocAdvanced(
return mem.bytesAsSlice(T, new_bytes);
}
/// Free an array allocated with `alloc`. To free a single item,
/// see `destroy`.
/// Free an array allocated with `alloc`.
/// If memory has length 0, free is a no-op.
/// To free a single item, see `destroy`.
pub fn free(self: Allocator, memory: anytype) void {
const Slice = @typeInfo(@TypeOf(memory)).pointer;
const bytes = mem.sliceAsBytes(memory);