From 44c366589ec399d6fe25bda599f643107d5ef4bb Mon Sep 17 00:00:00 2001 From: Kevin Ding Date: Wed, 29 Oct 2025 15:19:54 +0800 Subject: [PATCH 1/2] lsan: fix allocator on arm64 Android The default config is too large for arm64 Android devices, which are typically configured with 39-bit address space. This change brings it inline with sanitizer_allocator_test.cpp. --- compiler-rt/lib/lsan/lsan_allocator.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h index 556b9f56a4a4a..3a358cb4505c1 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.h +++ b/compiler-rt/lib/lsan/lsan_allocator.h @@ -93,6 +93,10 @@ using LSanSizeClassMap = DefaultSizeClassMap; const uptr kAllocatorSpace = 0x600000000000ULL; const uptr kAllocatorSize = 0x40000000000ULL; // 4T. using LSanSizeClassMap = DefaultSizeClassMap; +# elif SANITIZER_ANDROID && defined(__aarch64__) +const uptr kAllocatorSpace = 0x3000000000ULL; +const uptr kAllocatorSize = 0x2000000000ULL; +using LSanSizeClassMap = VeryCompactSizeClassMap; # else const uptr kAllocatorSpace = 0x500000000000ULL; const uptr kAllocatorSize = 0x40000000000ULL; // 4T. From 75755311d5189c9ddc22420ff155c048bc5bd274 Mon Sep 17 00:00:00 2001 From: Kevin Ding Date: Thu, 30 Oct 2025 14:33:01 +0800 Subject: [PATCH 2/2] fix code formatter failure --- compiler-rt/lib/lsan/lsan_allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h index 3a358cb4505c1..2d0ea0b46fe0e 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.h +++ b/compiler-rt/lib/lsan/lsan_allocator.h @@ -95,7 +95,7 @@ const uptr kAllocatorSize = 0x40000000000ULL; // 4T. using LSanSizeClassMap = DefaultSizeClassMap; # elif SANITIZER_ANDROID && defined(__aarch64__) const uptr kAllocatorSpace = 0x3000000000ULL; -const uptr kAllocatorSize = 0x2000000000ULL; +const uptr kAllocatorSize = 0x2000000000ULL; using LSanSizeClassMap = VeryCompactSizeClassMap; # else const uptr kAllocatorSpace = 0x500000000000ULL;