| ... | @@ -159,7 +159,7 @@ fn moveBytes( | ... | @@ -159,7 +159,7 @@ fn moveBytes( |
| 159 | /// Returns a pointer to undefined memory. | 159 | /// Returns a pointer to undefined memory. |
| 160 | /// Call `destroy` with the result to free the memory. | 160 | /// Call `destroy` with the result to free the memory. |
| 161 | pub fn create(self: *Allocator, comptime T: type) Error!*T { | 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 | const slice = try self.allocAdvancedWithRetAddr(T, null, 1, .exact, @returnAddress()); | 163 | const slice = try self.allocAdvancedWithRetAddr(T, null, 1, .exact, @returnAddress()); |
| 164 | return &slice[0]; | 164 | return &slice[0]; |
| 165 | } | 165 | } |