musl: remove macro redefinitions of malloc

This commit is contained in:
Andrew Kelley 2026-02-10 19:52:01 -08:00
parent 6ccabbd4e5
commit e2fccd8dd5
13 changed files with 0 additions and 66 deletions

View file

@ -11,11 +11,6 @@
#include "pthread_impl.h"
#include "aio_impl.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc __libc_realloc
#define free __libc_free
/* The following is a threads-based implementation of AIO with minimal
* dependence on implementation details. Most synchronization is
* performed with pthread primitives, but atomics and futex operations

View file

@ -4,11 +4,6 @@
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc undef
#define free undef
/* Ensure that at least 32 atexit handlers can be registered without malloc */
#define COUNT 32

View file

@ -10,10 +10,4 @@ hidden int __ptsname_r(int, char *, size_t);
hidden char *__randname(char *);
hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
hidden void *__libc_malloc(size_t);
hidden void *__libc_malloc_impl(size_t);
hidden void *__libc_calloc(size_t, size_t);
hidden void *__libc_realloc(void *, size_t);
hidden void __libc_free(void *);
#endif

View file

@ -5,11 +5,6 @@
#include "dynlink.h"
#include "atomic.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc __libc_realloc
#define free __libc_free
char *dlerror()
{
pthread_t self = __pthread_self();

View file

@ -12,11 +12,6 @@
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc undef
#define free undef
struct binding {
struct binding *next;
int dirlen;

View file

@ -3,11 +3,6 @@
#include "locale_impl.h"
#include "libc.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
locale_t __duplocale(locale_t old)
{
locale_t new = malloc(sizeof *new);

View file

@ -1,11 +1,6 @@
#include <stdlib.h>
#include "locale_impl.h"
#define malloc undef
#define calloc undef
#define realloc undef
#define free __libc_free
void freelocale(locale_t l)
{
if (__loc_is_allocated(l)) free(l);

View file

@ -7,11 +7,6 @@
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
const char *__lctrans_impl(const char *msg, const struct __locale_map *lm)
{
const char *trans = 0;

View file

@ -4,11 +4,6 @@
#include "locale_impl.h"
#include "lock.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
static int default_locale_init_done;
static struct __locale_struct default_locale, default_ctype_locale;

View file

@ -10,8 +10,3 @@ struct fdop {
mode_t mode;
char path[];
};
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc undef
#define free __libc_free

View file

@ -3,11 +3,6 @@
#include "libc.h"
#include "lock.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
static struct atfork_funcs {
void (*prepare)(void);
void (*parent)(void);

View file

@ -14,11 +14,6 @@
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc __libc_calloc
#define realloc undef
#define free undef
static struct {
ino_t ino;
sem_t *sem;

View file

@ -9,11 +9,6 @@
#include "lock.h"
#include "fork_impl.h"
#define malloc __libc_malloc
#define calloc undef
#define realloc undef
#define free undef
long __timezone = 0;
int __daylight = 0;
char *__tzname[2] = { 0, 0 };