[compiler-rt] lsan: fix allocator on arm64 Android (PR #165656)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 29 22:50:57 PDT 2025
https://github.com/quic-likaid created https://github.com/llvm/llvm-project/pull/165656
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.
>From 44c366589ec399d6fe25bda599f643107d5ef4bb Mon Sep 17 00:00:00 2001
From: Kevin Ding <likaid at qti.qualcomm.com>
Date: Wed, 29 Oct 2025 15:19:54 +0800
Subject: [PATCH] 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.
More information about the llvm-commits
mailing list