Skip to content

Commit 404746b

Browse files
Calandracas606Daniel Martinez
authored andcommitted
[nsan] Remove mallopt from nsan_interceptors (llvm#101055)
Fixes a build failure on 19.1.0-rc1 when building on linux with musl as the libc musl does not provide mallopt, whereas glibc does. mallopt has portability issues with other libc implementations. Just remove the use. Co-authored-by: Daniel Martinez <[email protected]> (cherry picked from commit 2c3eb8d)
1 parent 9536b02 commit 404746b

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

compiler-rt/lib/nsan/nsan_interceptors.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121

2222
#include <wchar.h>
2323

24-
#if SANITIZER_LINUX
25-
extern "C" int mallopt(int param, int value);
26-
#endif
27-
2824
using namespace __sanitizer;
2925
using __nsan::nsan_init_is_running;
3026
using __nsan::nsan_initialized;
@@ -209,12 +205,6 @@ void __nsan::InitializeInterceptors() {
209205
static bool initialized = false;
210206
CHECK(!initialized);
211207

212-
// Instruct libc malloc to consume less memory.
213-
#if SANITIZER_LINUX
214-
mallopt(1, 0); // M_MXFAST
215-
mallopt(-3, 32 * 1024); // M_MMAP_THRESHOLD
216-
#endif
217-
218208
InitializeMallocInterceptors();
219209

220210
INTERCEPT_FUNCTION(memset);

0 commit comments

Comments
 (0)