Skip to content

Commit ab03fed

Browse files
author
Daniel Martinez
committed
don't use mallopt on musl
1 parent 708a9a0 commit ab03fed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/lib/nsan/nsan_interceptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <wchar.h>
2323

24-
#if SANITIZER_LINUX
24+
#if SANITIZER_LINUX && defined(__GLIBC__)
2525
extern "C" int mallopt(int param, int value);
2626
#endif
2727

@@ -210,7 +210,7 @@ void __nsan::InitializeInterceptors() {
210210
CHECK(!initialized);
211211

212212
// Instruct libc malloc to consume less memory.
213-
#if SANITIZER_LINUX
213+
#if SANITIZER_LINUX && defined(__GLIBC__)
214214
mallopt(1, 0); // M_MXFAST
215215
mallopt(-3, 32 * 1024); // M_MMAP_THRESHOLD
216216
#endif

0 commit comments

Comments
 (0)