diff options
| author | JF Bastien <jfbastien@apple.com> | 2019-04-26 22:29:49 +0000 |
|---|---|---|
| committer | JF Bastien <jfbastien@apple.com> | 2019-04-26 22:29:49 +0000 |
| commit | 8504b5f64f47d54c83f66670e804dc70c6112dae (patch) | |
| tree | dcca73769d672d04ba860c64fe70d689718e395d | |
| parent | 76f64b665bb12b0097a71c10b21a1d302bc84229 (diff) | |
| download | bcm5719-llvm-8504b5f64f47d54c83f66670e804dc70c6112dae.tar.gz bcm5719-llvm-8504b5f64f47d54c83f66670e804dc70c6112dae.zip | |
Revert "[sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type"
Fails on bots with:
/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h:69:3: error: static_assert failed due to requirement 'TwoLevelByteMapSize1 > 128' "TwoLevelByteMap should be used"
static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h:29:34: note: in instantiation of template class '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>' requested here
typename PrimaryAllocator::AddressSpaceView>::value,
^
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13960/console
llvm-svn: 359352
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h index 04f032605ab..d773815f9c6 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h @@ -47,10 +47,6 @@ struct SizeClassAllocator32FlagMasks { // Bit masks. template <class Params> class SizeClassAllocator32 { - private: - static const u64 TwoLevelByteMapSize1 = - (Params::kSpaceSize >> Params::kRegionSizeLog) >> 12; - public: using AddressSpaceView = typename Params::AddressSpaceView; static const uptr kSpaceBeg = Params::kSpaceBeg; @@ -62,12 +58,12 @@ class SizeClassAllocator32 { typedef typename Params::MapUnmapCallback MapUnmapCallback; #if SANITIZER_WORDSIZE == 32 - static_assert(TwoLevelByteMapSize1 <= 128, "FlatByteMap should be used"); using BM = FlatByteMap<(Params::kSpaceSize >> Params::kRegionSizeLog), AddressSpaceView>; #elif SANITIZER_WORDSIZE == 64 - static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used"); - using BM = TwoLevelByteMap<TwoLevelByteMapSize1, 1 << 12, AddressSpaceView>; + using BM = + TwoLevelByteMap<((Params::kSpaceSize >> Params::kRegionSizeLog) >> 12), + 1 << 12, AddressSpaceView>; #endif static_assert((Params::kFlags & SizeClassAllocator32FlagMasks::kForTest) || is_same<BM, ByteMap>::value, |

