[compiler-rt][lsan] Choose lsan allocator via SANITIZER_CAN_USE_ALLOCATOR64

Rather than checking a bunch of individual platforms.

Differential Revision: https://reviews.llvm.org/D126825
This commit is contained in:
Leonard Chan 2022-06-01 14:12:13 -07:00
parent dd045ddffc
commit 4b15e665f8
2 changed files with 4 additions and 4 deletions

View File

@ -49,8 +49,7 @@ struct ChunkMetadata {
u32 stack_trace_id;
};
#if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__)
#if !SANITIZER_CAN_USE_ALLOCATOR64
template <typename AddressSpaceViewTy>
struct AP32 {
static const uptr kSpaceBeg = 0;
@ -65,7 +64,7 @@ struct AP32 {
template <typename AddressSpaceView>
using PrimaryAllocatorASVT = SizeClassAllocator32<AP32<AddressSpaceView>>;
using PrimaryAllocator = PrimaryAllocatorASVT<LocalAddressSpaceView>;
#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__)
#else
# if SANITIZER_FUCHSIA || defined(__powerpc64__)
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.

View File

@ -285,7 +285,8 @@
#ifndef SANITIZER_CAN_USE_ALLOCATOR64
# if (SANITIZER_ANDROID && defined(__aarch64__)) || SANITIZER_FUCHSIA
# define SANITIZER_CAN_USE_ALLOCATOR64 1
# elif defined(__mips64) || defined(__aarch64__)
# elif defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__)
# define SANITIZER_CAN_USE_ALLOCATOR64 0
# else
# define SANITIZER_CAN_USE_ALLOCATOR64 (SANITIZER_WORDSIZE == 64)