[compiler-rt] 9efaff1 - [NFC][lsan] Extract and rename SizeClassMap type from AP64 (#69526)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 11:50:04 PDT 2023
Author: PiJoules
Date: 2023-10-23T11:49:59-07:00
New Revision: 9efaff1b0cca33e0a0c881c8111342f8bb8212e4
URL: https://github.com/llvm/llvm-project/commit/9efaff1b0cca33e0a0c881c8111342f8bb8212e4
DIFF: https://github.com/llvm/llvm-project/commit/9efaff1b0cca33e0a0c881c8111342f8bb8212e4.diff
LOG: [NFC][lsan] Extract and rename SizeClassMap type from AP64 (#69526)
This will make it easier to read rather than using SizeClassMap in the
same namespace.
Added:
Modified:
compiler-rt/lib/lsan/lsan_allocator.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h
index f5486150a8121f1..7197e0a736298fb 100644
--- a/compiler-rt/lib/lsan/lsan_allocator.h
+++ b/compiler-rt/lib/lsan/lsan_allocator.h
@@ -69,22 +69,26 @@ using PrimaryAllocator = PrimaryAllocatorASVT<LocalAddressSpaceView>;
# if SANITIZER_FUCHSIA || defined(__powerpc64__)
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+using LSanSizeClassMap = DefaultSizeClassMap;
# elif SANITIZER_RISCV64
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x2000000000ULL; // 128G.
+using LSanSizeClassMap = DefaultSizeClassMap;
# elif SANITIZER_APPLE
const uptr kAllocatorSpace = 0x600000000000ULL;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+using LSanSizeClassMap = DefaultSizeClassMap;
# else
const uptr kAllocatorSpace = 0x500000000000ULL;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+using LSanSizeClassMap = DefaultSizeClassMap;
# endif
template <typename AddressSpaceViewTy>
struct AP64 { // Allocator64 parameters. Deliberately using a short name.
static const uptr kSpaceBeg = kAllocatorSpace;
static const uptr kSpaceSize = kAllocatorSize;
static const uptr kMetadataSize = sizeof(ChunkMetadata);
- typedef DefaultSizeClassMap SizeClassMap;
+ using SizeClassMap = LSanSizeClassMap;
typedef NoOpMapUnmapCallback MapUnmapCallback;
static const uptr kFlags = 0;
using AddressSpaceView = AddressSpaceViewTy;
More information about the llvm-commits
mailing list