mirror of
https://github.com/ziglang/zig.git
synced 2024-11-25 05:40:16 +00:00
Merge 99d812cfd2
into a5d4ad17b7
This commit is contained in:
commit
a9799ce755
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user