[compiler-rt] b37d84a - Reland "[NFC][compiler-rt][asan] Unify asan and lsan allocator settings"
Leonard Chan via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 18:11:17 PDT 2022
Author: Leonard Chan
Date: 2022-06-07T18:09:48-07:00
New Revision: b37d84aa8d59dde2fae7388da5101bf471ec3434
URL: https://github.com/llvm/llvm-project/commit/b37d84aa8d59dde2fae7388da5101bf471ec3434
DIFF: https://github.com/llvm/llvm-project/commit/b37d84aa8d59dde2fae7388da5101bf471ec3434.diff
LOG: Reland "[NFC][compiler-rt][asan] Unify asan and lsan allocator settings"
I believe this should've been fixed with 4b15e665f8d99d3b67b30e615544279654392745
which landed after this initial patch, but I reverted too early before I
saw the builder turn green again.
Added:
Modified:
compiler-rt/lib/asan/asan_allocator.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index 27d826fb613a..fed49b37dc56 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -17,6 +17,7 @@
#include "asan_flags.h"
#include "asan_interceptors.h"
#include "asan_internal.h"
+#include "lsan/lsan_allocator.h"
#include "sanitizer_common/sanitizer_allocator.h"
#include "sanitizer_common/sanitizer_list.h"
#include "sanitizer_common/sanitizer_platform.h"
@@ -118,12 +119,9 @@ struct AsanMapUnmapCallback {
};
#if SANITIZER_CAN_USE_ALLOCATOR64
-# if SANITIZER_FUCHSIA
-const uptr kAllocatorSpace = ~(uptr)0;
-const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
-typedef DefaultSizeClassMap SizeClassMap;
-# elif defined(__powerpc64__)
+# if defined(__powerpc64__)
const uptr kAllocatorSpace = ~(uptr)0;
+// NOTE: This
diff ers slightly from the LSan allocator size which is 4T.
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
typedef DefaultSizeClassMap SizeClassMap;
# elif defined(__aarch64__) && SANITIZER_ANDROID
@@ -150,8 +148,9 @@ const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x8000000000ULL; // 500G
typedef DefaultSizeClassMap SizeClassMap;
# else
-const uptr kAllocatorSpace = 0x600000000000ULL;
-const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+// Use LSan's allocator configs.
+const uptr kAllocatorSpace = __lsan::kAllocatorSpace;
+const uptr kAllocatorSize = __lsan::kAllocatorSize;
typedef DefaultSizeClassMap SizeClassMap;
# endif
template <typename AddressSpaceViewTy>
More information about the llvm-commits
mailing list