summaryrefslogtreecommitdiff
path: root/src/locale/newlocale.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-12-09 17:11:05 -0500
committerRich Felker <dalias@aerifal.cx>2020-12-09 17:11:05 -0500
commit1e4204d522670a1d8b8ab85f1cfefa960547e8af (patch)
tree807a8e86728f9b18e6f18d9ed0b75fe22e8a020c /src/locale/newlocale.c
parent36246b347cd135399bc79f9b6617d9a120c00a0d (diff)
downloadmusl-1e4204d522670a1d8b8ab85f1cfefa960547e8af.tar.gz
use libc-internal malloc for newlocale/freelocale
this is necessary for MT-fork correctness now that the code runs under locale lock. it would not be hard to avoid, but __get_locale is already using libc-internal malloc anyway. this can be reconsidered during locale overhaul later if needed.
Diffstat (limited to 'src/locale/newlocale.c')
-rw-r--r--src/locale/newlocale.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c
index 12ae87d6..9ac3cd38 100644
--- a/src/locale/newlocale.c
+++ b/src/locale/newlocale.c
@@ -4,6 +4,11 @@
#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;