| author | |
| committer | |
| log | bf1d83482b581e49499e545cc625155c1043ef0c |
| tree | 88282849a586f54798e64458db4311193aa6c72d |
| parent | fb3c5b84ede6fa48949c8069bf735ac67ec21091 |
| signature |
1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/mem/Allocator.zig+1-1| ... | ... | @@ -159,7 +159,7 @@ fn moveBytes( |
| 159 | 159 | /// Returns a pointer to undefined memory. |
| 160 | 160 | /// Call `destroy` with the result to free the memory. |
| 161 | 161 | pub fn create(self: *Allocator, comptime T: type) Error!*T { |
| 162 | if (@sizeOf(T) == 0) return &(T{}); | |
| 162 | if (@sizeOf(T) == 0) return @as(*T, undefined); | |
| 163 | 163 | const slice = try self.allocAdvancedWithRetAddr(T, null, 1, .exact, @returnAddress()); |
| 164 | 164 | return &slice[0]; |
| 165 | 165 | } |