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