[compiler-rt] ac2bc4e - tsan: remove mallopt calls

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 07:18:13 PDT 2021


Author: Dmitry Vyukov
Date: 2021-08-03T16:18:09+02:00
New Revision: ac2bc4e0fc4c0c9d4903b49b445451d5d42356db

URL: https://github.com/llvm/llvm-project/commit/ac2bc4e0fc4c0c9d4903b49b445451d5d42356db
DIFF: https://github.com/llvm/llvm-project/commit/ac2bc4e0fc4c0c9d4903b49b445451d5d42356db.diff

LOG: tsan: remove mallopt calls

mallopt calls are left-over from the times we used
__libc_malloc/__libc_free for internal allocations.
Now we have own internal allocator, so this is not needed.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107342

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index f1a487897418..43a9514554c2 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -96,9 +96,6 @@ extern "C" void _exit(int status);
 extern "C" int fileno_unlocked(void *stream);
 extern "C" int dirfd(void *dirp);
 #endif
-#if SANITIZER_GLIBC
-extern "C" int mallopt(int param, int value);
-#endif
 #if SANITIZER_NETBSD
 extern __sanitizer_FILE __sF[];
 #else
@@ -2668,12 +2665,6 @@ void InitializeInterceptors() {
   REAL(memcpy) = internal_memcpy;
 #endif
 
-  // Instruct libc malloc to consume less memory.
-#if SANITIZER_GLIBC
-  mallopt(1, 0);  // M_MXFAST
-  mallopt(-3, 32*1024);  // M_MMAP_THRESHOLD
-#endif
-
   new(interceptor_ctx()) InterceptorContext();
 
   InitializeCommonInterceptors();


        


More information about the llvm-commits mailing list