Skip to content

Commit e586f12

Browse files
committed
Set allocator size and beginning
1 parent c7d8581 commit e586f12

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

compiler-rt/lib/asan/asan_allocator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ const uptr kAllocatorSpace = ~(uptr)0;
197197
# endif // SANITIZER_APPLE
198198

199199
# if defined(__powerpc64__)
200+
# if SANITIZER_AIX
201+
const uptr kAllocatorSize = 1ULL << 38; // 256G.
202+
# else
200203
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
204+
# endif
201205
typedef DefaultSizeClassMap SizeClassMap;
202206
# elif defined(__aarch64__) && SANITIZER_ANDROID
203207
// Android needs to support 39, 42 and 48 bit VMA.

compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ namespace __sanitizer {
2323
typedef CompactSizeClassMap InternalSizeClassMap;
2424

2525
struct AP32 {
26+
// For AIX 64-bit, the mmap begin is at address 0x0a00000000000000ULL.
27+
#if SANITIZER_AIX && SANITIZER_WORDSIZE == 64
28+
static const uptr kSpaceBeg = 0x0a00000000000000ULL;
29+
#else
2630
static const uptr kSpaceBeg = 0;
31+
#endif
2732
static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE;
2833
static const uptr kMetadataSize = 0;
2934
typedef InternalSizeClassMap SizeClassMap;

compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class SizeClassAllocator32 {
288288
uptr ComputeRegionId(uptr mem) const {
289289
if (SANITIZER_SIGN_EXTENDED_ADDRESSES)
290290
mem &= (kSpaceSize - 1);
291+
mem -= kSpaceBeg;
291292
const uptr res = mem >> kRegionSizeLog;
292293
CHECK_LT(res, kNumPossibleRegions);
293294
return res;

0 commit comments

Comments
 (0)