mirror of
https://github.com/ziglang/zig.git
synced 2024-11-29 00:22:33 +00:00
back to malloc instead of aligned_alloc for c_allocator
it seems that a 7 years old standard is still too new for the libc variants that are ubiquitous (tests failing on macos for not providing C11 ABI)
This commit is contained in:
parent
4a4ea92cf3
commit
227ead54be
@ -17,7 +17,8 @@ var c_allocator_state = Allocator {
|
||||
};
|
||||
|
||||
fn cAlloc(self: &Allocator, n: usize, alignment: u29) ![]u8 {
|
||||
return if (c.aligned_alloc(alignment, n)) |buf|
|
||||
assert(alignment <= @alignOf(c_longdouble));
|
||||
return if (c.malloc(n)) |buf|
|
||||
@ptrCast(&u8, buf)[0..n]
|
||||
else
|
||||
error.OutOfMemory;
|
||||
|
Loading…
Reference in New Issue
Block a user