| author | |
| committer | |
| log | 737b366279984b5725673ef94b0e144ac5eca98e |
| tree | 4c2785f9c7efe910f179333178406d8a1f695993 |
| parent | feff968ec3b1edb0234549854b8ebbc95276bd18 |
1 files changed, 1 insertions(+), 0 deletions(-)
lib/std/mem/Allocator.zig+1| ... | ... | @@ -110,6 +110,7 @@ pub fn create(self: Allocator, comptime T: type) Error!*T { |
| 110 | 110 | /// have the same address and alignment property. |
| 111 | 111 | pub fn destroy(self: Allocator, ptr: anytype) void { |
| 112 | 112 | const info = @typeInfo(@TypeOf(ptr)).Pointer; |
| 113 | if (info.size != .One) @compileError("ptr must be a single item pointer"); | |
| 113 | 114 | const T = info.child; |
| 114 | 115 | if (@sizeOf(T) == 0) return; |
| 115 | 116 | const non_const_ptr = @as([*]u8, @ptrCast(@constCast(ptr))); |