it's not part of the malloc implementation but glue with musl dynamic linker.
@@ -20,8 +20,6 @@ static struct {
volatile int split_merge_lock[2];
} mal;
-int __malloc_replaced;
-
/* Synchronization tools */
static inline void lock(volatile int *lk)
@@ -0,0 +1,3 @@
+#include "dynlink.h"
+
+int __malloc_replaced;