Skip to content

[compiler-rt][lsan][Fuchsia] Adjust lsan allocator settings #69401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions compiler-rt/lib/lsan/lsan_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,23 @@ using PrimaryAllocator = PrimaryAllocatorASVT<LocalAddressSpaceView>;
#else
# if SANITIZER_FUCHSIA || defined(__powerpc64__)
const uptr kAllocatorSpace = ~(uptr)0;
# if SANITIZER_RISCV64
// See the comments in compiler-rt/lib/asan/asan_allocator.h for why these
// values were chosen.
const uptr kAllocatorSize = UINT64_C(1) << 33; // 8GB
using LSanSizeClassMap = SizeClassMap</*kNumBits=*/2,
/*kMinSizeLog=*/5,
/*kMidSizeLog=*/8,
/*kMaxSizeLog=*/18,
/*kNumCachedHintT=*/8,
/*kMaxBytesCachedLog=*/10>;
static_assert(LSanSizeClassMap::kNumClassesRounded <= 32,
"32 size classes is the optimal number to ensure tests run "
"effieciently on Fuchsia.");
# else
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
using LSanSizeClassMap = DefaultSizeClassMap;
# endif
# elif SANITIZER_RISCV64
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x2000000000ULL; // 128G.
Expand Down