diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2019-04-27 06:30:52 +0000 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2019-04-27 06:30:52 +0000 |
| commit | 0f21545a3c9e57b7df4c68aaff92cb83ae7ce5d2 (patch) | |
| tree | 25d9f486fe98e61e04c7cc2945981a96d1be7405 /compiler-rt/lib/msan | |
| parent | 57179860a0547afc482171ef304976c7761a3fd8 (diff) | |
| download | bcm5719-llvm-0f21545a3c9e57b7df4c68aaff92cb83ae7ce5d2.tar.gz bcm5719-llvm-0f21545a3c9e57b7df4c68aaff92cb83ae7ce5d2.zip | |
[sanitizer] Calculate SizeClassAllocator32::ByteMap type from Params::kSpaceSize and Params::kRegionSizeLog
Reviewers: eugenis
Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61206
llvm-svn: 359374
Diffstat (limited to 'compiler-rt/lib/msan')
| -rw-r--r-- | compiler-rt/lib/msan/msan_allocator.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler-rt/lib/msan/msan_allocator.cc b/compiler-rt/lib/msan/msan_allocator.cc index 51e8704f1df..48430b62133 100644 --- a/compiler-rt/lib/msan/msan_allocator.cc +++ b/compiler-rt/lib/msan/msan_allocator.cc @@ -46,18 +46,14 @@ struct MsanMapUnmapCallback { #if defined(__mips64) static const uptr kMaxAllowedMallocSize = 2UL << 30; -static const uptr kRegionSizeLog = 20; -static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; -typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; struct AP32 { static const uptr kSpaceBeg = 0; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = sizeof(Metadata); typedef __sanitizer::CompactSizeClassMap SizeClassMap; - static const uptr kRegionSizeLog = __msan::kRegionSizeLog; + static const uptr kRegionSizeLog = 20; using AddressSpaceView = LocalAddressSpaceView; - using ByteMap = __msan::ByteMap; typedef MsanMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; @@ -99,18 +95,14 @@ struct AP64 { // Allocator64 parameters. Deliberately using a short name. typedef SizeClassAllocator64<AP64> PrimaryAllocator; #elif defined(__aarch64__) static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G -static const uptr kRegionSizeLog = 20; -static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; -typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; struct AP32 { static const uptr kSpaceBeg = 0; static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kMetadataSize = sizeof(Metadata); typedef __sanitizer::CompactSizeClassMap SizeClassMap; - static const uptr kRegionSizeLog = __msan::kRegionSizeLog; + static const uptr kRegionSizeLog = 20; using AddressSpaceView = LocalAddressSpaceView; - using ByteMap = __msan::ByteMap; typedef MsanMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; |

