diff options
| author | Isaac Freund <mail@isaacfreund.com> | 2022-05-03 21:45:20 +0200 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2022-05-04 01:00:57 +0200 |
| commit | f4131cf8a645d7c857fb1c0401000cac0b50080b (patch) | |
| tree | 59b759c00e15760d76eeb4d1f0b0ad3ced0f6b24 /lib/libc/musl/src/malloc/mallocng/aligned_alloc.c | |
| parent | b6930825b0e59bc355370eb68f5b74868d8aa1d7 (diff) | |
| download | zig-f4131cf8a645d7c857fb1c0401000cac0b50080b.tar.gz zig-f4131cf8a645d7c857fb1c0401000cac0b50080b.zip | |
musl: update to 1.2.3
This was a bit trickier than it should be due to symbol conflicts with
zig's compiler-rt implementation. We attempt to use weak linkage in
our compiler-rt, but this does not seem to be working in all cases. I
manually disabled export of the problematic compiler-rt math functions
in order to cross compile musl's libc.so for all targets as input to
`tools/gen_stubs.zig`.
Other than that, this update went fairly smoothly. Quite a few
additional symbols were added to the blacklist in `tools/gen_stubs.zig`
due to recent reorganization of zig's compiler-rt.
Diffstat (limited to 'lib/libc/musl/src/malloc/mallocng/aligned_alloc.c')
| -rw-r--r-- | lib/libc/musl/src/malloc/mallocng/aligned_alloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c index 3411689600..e0862a83ae 100644 --- a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c +++ b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c @@ -22,6 +22,9 @@ void *aligned_alloc(size_t align, size_t len) if (align <= UNIT) align = UNIT; unsigned char *p = malloc(len + align - UNIT); + if (!p) + return 0; + struct meta *g = get_meta(p); int idx = get_slot_index(p); size_t stride = get_stride(g); |
