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