[compiler-rt] dd045dd - [NFC][compiler-rt][asan] Unify asan and lsan allocator settings
Leonard Chan via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 17:21:58 PDT 2022
Author: Leonard Chan
Date: 2022-06-07T17:21:19-07:00
New Revision: dd045ddffc51db0a5ff9e00b1d55220af20614be
URL: https://github.com/llvm/llvm-project/commit/dd045ddffc51db0a5ff9e00b1d55220af20614be
DIFF: https://github.com/llvm/llvm-project/commit/dd045ddffc51db0a5ff9e00b1d55220af20614be.diff
LOG: [NFC][compiler-rt][asan] Unify asan and lsan allocator settings
This updates existing asan allocator settings to use the same allocator settings as what lsan uses for platforms where they already match.
Differential Revision: https://reviews.llvm.org/D126927
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