diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h index a94ef958aa75e..247d8bb77c984 100644 --- a/compiler-rt/lib/asan/asan_allocator.h +++ b/compiler-rt/lib/asan/asan_allocator.h @@ -239,7 +239,7 @@ using PrimaryAllocator = PrimaryAllocatorASVT; typedef CompactSizeClassMap SizeClassMap; template struct AP32 { - static const uptr kSpaceBeg = 0; + static const uptr kSpaceBeg = SANITIZER_MMAP_BEGIN; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = 0; typedef __asan::SizeClassMap SizeClassMap; diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h index 2342f11fb5d0d..556b9f56a4a4a 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.h +++ b/compiler-rt/lib/lsan/lsan_allocator.h @@ -53,7 +53,7 @@ struct ChunkMetadata { #if !SANITIZER_CAN_USE_ALLOCATOR64 template struct AP32 { - static const uptr kSpaceBeg = 0; + static const uptr kSpaceBeg = SANITIZER_MMAP_BEGIN; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = sizeof(ChunkMetadata); typedef __sanitizer::CompactSizeClassMap SizeClassMap; diff --git a/compiler-rt/lib/msan/msan_allocator.cpp b/compiler-rt/lib/msan/msan_allocator.cpp index d7d4967c94985..2b543db49d36e 100644 --- a/compiler-rt/lib/msan/msan_allocator.cpp +++ b/compiler-rt/lib/msan/msan_allocator.cpp @@ -56,7 +56,7 @@ struct MsanMapUnmapCallback { const uptr kMaxAllowedMallocSize = 2UL << 30; struct AP32 { - static const uptr kSpaceBeg = 0; + static const uptr kSpaceBeg = SANITIZER_MMAP_BEGIN; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = sizeof(Metadata); using SizeClassMap = __sanitizer::CompactSizeClassMap; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h index 62523c7ae187c..6c2020e6373c0 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h @@ -23,7 +23,7 @@ namespace __sanitizer { typedef CompactSizeClassMap InternalSizeClassMap; struct AP32 { - static const uptr kSpaceBeg = 0; + static const uptr kSpaceBeg = SANITIZER_MMAP_BEGIN; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = 0; typedef InternalSizeClassMap SizeClassMap; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h index 4c8d9a9b86bed..196c0a988478e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -318,6 +318,9 @@ # endif #endif +// The first address that can be returned by mmap. +#define SANITIZER_MMAP_BEGIN 0 + // The range of addresses which can be returned my mmap. // FIXME: this value should be different on different platforms. Larger values // will still work but will consume more memory for TwoLevelByteMap. diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/compiler-rt/lib/tsan/rtl/tsan_rtl.h index 0be53599b6a49..dc32980e905f2 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.h +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.h @@ -62,7 +62,7 @@ struct MapUnmapCallback; defined(__powerpc__) || SANITIZER_RISCV64 struct AP32 { - static const uptr kSpaceBeg = 0; + static const uptr kSpaceBeg = SANITIZER_MMAP_BEGIN; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = 0; typedef __sanitizer::CompactSizeClassMap SizeClassMap;