[compiler-rt] 54a1e05 - [asan][AIX] Set allocator size and beginning (#144784)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 9 09:49:49 PST 2026
Author: Jake Egan
Date: 2026-01-09T12:49:45-05:00
New Revision: 54a1e05d3c5eac476a0b14d2d7a712c7ece2c255
URL: https://github.com/llvm/llvm-project/commit/54a1e05d3c5eac476a0b14d2d7a712c7ece2c255
DIFF: https://github.com/llvm/llvm-project/commit/54a1e05d3c5eac476a0b14d2d7a712c7ece2c255.diff
LOG: [asan][AIX] Set allocator size and beginning (#144784)
On 64-bit AIX, set allocator size to 256G and set beginning to
0x0a00000000000000.
Issue: #138916
---------
Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
Added:
Modified:
compiler-rt/lib/asan/asan_allocator.h
compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h
compiler-rt/lib/sanitizer_common/sanitizer_platform.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index 7798137246cf4..4131fda096930 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -198,7 +198,11 @@ const uptr kAllocatorSpace = ~(uptr)0;
# endif // SANITIZER_APPLE
# if defined(__powerpc64__)
+# if SANITIZER_AIX
+const uptr kAllocatorSize = 1ULL << 38; // 256G.
+# else
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
+# endif
typedef DefaultSizeClassMap SizeClassMap;
# elif defined(__aarch64__) && \
(SANITIZER_ANDROID || defined(SANITIZER_AARCH64_39BIT_VA))
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h
index 602b197c42ae3..0faf9b3c151a4 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h
@@ -288,6 +288,7 @@ class SizeClassAllocator32 {
uptr ComputeRegionId(uptr mem) const {
if (SANITIZER_SIGN_EXTENDED_ADDRESSES)
mem &= (kSpaceSize - 1);
+ mem -= kSpaceBeg;
const uptr res = mem >> kRegionSizeLog;
CHECK_LT(res, kNumPossibleRegions);
return res;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 1b47f3e24d12d..acd2da26117c3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -319,7 +319,11 @@
#endif
// The first address that can be returned by mmap.
-#define SANITIZER_MMAP_BEGIN 0
+#if SANITIZER_AIX && SANITIZER_WORDSIZE == 64
+# define SANITIZER_MMAP_BEGIN 0x0a00'0000'0000'0000ULL
+#else
+# define SANITIZER_MMAP_BEGIN 0
+#endif
// The range of addresses which can be returned my mmap.
// FIXME: this value should be
diff erent on
diff erent platforms. Larger values
More information about the llvm-commits
mailing list