| ... | @@ -200,12 +200,9 @@ pub fn allocAdvancedWithRetAddr( | ... | @@ -200,12 +200,9 @@ pub fn allocAdvancedWithRetAddr( |
| 200 | n: usize, | 200 | n: usize, |
| 201 | return_address: usize, | 201 | return_address: usize, |
| 202 | ) Error![]align(alignment orelse @alignOf(T)) T { | 202 | ) Error![]align(alignment orelse @alignOf(T)) T { |
| 203 | const a = if (alignment) |a| blk: { | 203 | const a = alignment orelse @alignOf(T); |
| 204 | if (a == @alignOf(T)) return allocAdvancedWithRetAddr(self, T, null, n, return_address); | | |
| 205 | break :blk a; | | |
| 206 | } else @alignOf(T); | | |
| 207 | | 204 | |
| 208 | // The Zig Allocator interface is not intended to solve allocations beyond | 205 | // The Zig Allocator interface is not intended to solve alignments beyond |
| 209 | // the minimum OS page size. For these use cases, the caller must use OS | 206 | // the minimum OS page size. For these use cases, the caller must use OS |
| 210 | // APIs directly. | 207 | // APIs directly. |
| 211 | comptime assert(a <= mem.page_size); | 208 | comptime assert(a <= mem.page_size); |