authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-10 19:52:01-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-12 13:14:51-08:00
loge2fccd8dd5c09ed805c000a6c26c7d1eb1e7d6c1
tree1313ce3d3439a1559b9b6b15edd58c52bd447e15
parent6ccabbd4e558dd0d56c471408c4cf29e0992dc1c

musl: remove macro redefinitions of malloc


13 files changed, 0 insertions(+), 66 deletions(-)

lib/libc/musl/src/aio/aio.c-5
......@@ -11,11 +11,6 @@
1111#include "pthread_impl.h"
1212#include "aio_impl.h"
1313
14#define malloc __libc_malloc
15#define calloc __libc_calloc
16#define realloc __libc_realloc
17#define free __libc_free
18
1914/* The following is a threads-based implementation of AIO with minimal
2015 * dependence on implementation details. Most synchronization is
2116 * performed with pthread primitives, but atomics and futex operations
lib/libc/musl/src/exit/atexit.c-5
......@@ -4,11 +4,6 @@
44#include "lock.h"
55#include "fork_impl.h"
66
7#define malloc __libc_malloc
8#define calloc __libc_calloc
9#define realloc undef
10#define free undef
11
127/* Ensure that at least 32 atexit handlers can be registered without malloc */
138#define COUNT 32
149
lib/libc/musl/src/include/stdlib.h-6
......@@ -10,10 +10,4 @@ hidden int __ptsname_r(int, char *, size_t);
1010hidden char *__randname(char *);
1111hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
1212
13hidden void *__libc_malloc(size_t);
14hidden void *__libc_malloc_impl(size_t);
15hidden void *__libc_calloc(size_t, size_t);
16hidden void *__libc_realloc(void *, size_t);
17hidden void __libc_free(void *);
18
1913#endif
lib/libc/musl/src/ldso/dlerror.c-5
......@@ -5,11 +5,6 @@
55#include "dynlink.h"
66#include "atomic.h"
77
8#define malloc __libc_malloc
9#define calloc __libc_calloc
10#define realloc __libc_realloc
11#define free __libc_free
12
138char *dlerror()
149{
1510 pthread_t self = __pthread_self();
lib/libc/musl/src/locale/dcngettext.c-5
......@@ -12,11 +12,6 @@
1212#include "lock.h"
1313#include "fork_impl.h"
1414
15#define malloc __libc_malloc
16#define calloc __libc_calloc
17#define realloc undef
18#define free undef
19
2015struct binding {
2116 struct binding *next;
2217 int dirlen;
lib/libc/musl/src/locale/duplocale.c-5
......@@ -3,11 +3,6 @@
33#include "locale_impl.h"
44#include "libc.h"
55
6#define malloc __libc_malloc
7#define calloc undef
8#define realloc undef
9#define free undef
10
116locale_t __duplocale(locale_t old)
127{
138 locale_t new = malloc(sizeof *new);
lib/libc/musl/src/locale/freelocale.c-5
......@@ -1,11 +1,6 @@
11#include <stdlib.h>
22#include "locale_impl.h"
33
4#define malloc undef
5#define calloc undef
6#define realloc undef
7#define free __libc_free
8
94void freelocale(locale_t l)
105{
116 if (__loc_is_allocated(l)) free(l);
lib/libc/musl/src/locale/locale_map.c-5
......@@ -7,11 +7,6 @@
77#include "lock.h"
88#include "fork_impl.h"
99
10#define malloc __libc_malloc
11#define calloc undef
12#define realloc undef
13#define free undef
14
1510const char *__lctrans_impl(const char *msg, const struct __locale_map *lm)
1611{
1712 const char *trans = 0;
lib/libc/musl/src/locale/newlocale.c-5
......@@ -4,11 +4,6 @@
44#include "locale_impl.h"
55#include "lock.h"
66
7#define malloc __libc_malloc
8#define calloc undef
9#define realloc undef
10#define free undef
11
127static int default_locale_init_done;
138static struct __locale_struct default_locale, default_ctype_locale;
149
lib/libc/musl/src/process/fdop.h-5
......@@ -10,8 +10,3 @@ struct fdop {
1010 mode_t mode;
1111 char path[];
1212};
13
14#define malloc __libc_malloc
15#define calloc __libc_calloc
16#define realloc undef
17#define free __libc_free
lib/libc/musl/src/thread/pthread_atfork.c-5
......@@ -3,11 +3,6 @@
33#include "libc.h"
44#include "lock.h"
55
6#define malloc __libc_malloc
7#define calloc undef
8#define realloc undef
9#define free undef
10
116static struct atfork_funcs {
127 void (*prepare)(void);
138 void (*parent)(void);
lib/libc/musl/src/thread/sem_open.c-5
......@@ -14,11 +14,6 @@
1414#include "lock.h"
1515#include "fork_impl.h"
1616
17#define malloc __libc_malloc
18#define calloc __libc_calloc
19#define realloc undef
20#define free undef
21
2217static struct {
2318 ino_t ino;
2419 sem_t *sem;
lib/libc/musl/src/time/__tz.c-5
......@@ -9,11 +9,6 @@
99#include "lock.h"
1010#include "fork_impl.h"
1111
12#define malloc __libc_malloc
13#define calloc undef
14#define realloc undef
15#define free undef
16
1712long __timezone = 0;
1813int __daylight = 0;
1914char *__tzname[2] = { 0, 0 };