[compiler-rt] [NFC][lsan] Extract and rename SizeClassMap type from AP64 (PR #69526)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 14:22:59 PDT 2023
https://github.com/PiJoules created https://github.com/llvm/llvm-project/pull/69526
This will make it easier to read rather than using SizeClassMap in the same namespace.
>From 7a75a69ca3eef1c9afbd0ee2ca0b836f8663dbc7 Mon Sep 17 00:00:00 2001
From: Leonard Chan <leonardchan at google.com>
Date: Wed, 18 Oct 2023 21:11:44 +0000
Subject: [PATCH] [NFC][lsan] Extract and rename SizeClassMap type from AP64
This will make it easier to read rather than using SizeClassMap in the
same namespace.
---
compiler-rt/lib/lsan/lsan_allocator.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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