summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2019-04-27 06:30:52 +0000
committerVitaly Buka <vitalybuka@google.com>2019-04-27 06:30:52 +0000
commit0f21545a3c9e57b7df4c68aaff92cb83ae7ce5d2 (patch)
tree25d9f486fe98e61e04c7cc2945981a96d1be7405 /compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
parent57179860a0547afc482171ef304976c7761a3fd8 (diff)
downloadbcm5719-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/sanitizer_common/tests/sanitizer_allocator_test.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
index dcbe46f6f80..d19b37609d6 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
@@ -143,7 +143,6 @@ static const u64 kAddressSpaceSize = 1ULL << 32;
#endif
static const uptr kRegionSizeLog = FIRST_32_SECOND_64(20, 24);
-static const uptr kFlatByteMapSize = kAddressSpaceSize >> kRegionSizeLog;
template <typename AddressSpaceViewTy>
struct AP32Compact {
@@ -153,9 +152,8 @@ struct AP32Compact {
typedef CompactSizeClassMap SizeClassMap;
static const uptr kRegionSizeLog = ::kRegionSizeLog;
using AddressSpaceView = AddressSpaceViewTy;
- using ByteMap = FlatByteMap<kFlatByteMapSize, AddressSpaceView>;
typedef NoOpMapUnmapCallback MapUnmapCallback;
- static const uptr kFlags = SizeClassAllocator32FlagMasks::kForTest;
+ static const uptr kFlags = 0;
};
template <typename AddressSpaceView>
using Allocator32CompactASVT =
@@ -299,11 +297,9 @@ struct AP32SeparateBatches {
typedef DefaultSizeClassMap SizeClassMap;
static const uptr kRegionSizeLog = ::kRegionSizeLog;
using AddressSpaceView = AddressSpaceViewTy;
- using ByteMap = FlatByteMap<kFlatByteMapSize, AddressSpaceView>;
typedef NoOpMapUnmapCallback MapUnmapCallback;
static const uptr kFlags =
- SizeClassAllocator32FlagMasks::kUseSeparateSizeClassForBatch |
- SizeClassAllocator32FlagMasks::kForTest;
+ SizeClassAllocator32FlagMasks::kUseSeparateSizeClassForBatch;
};
template <typename AddressSpaceView>
using Allocator32SeparateBatchesASVT =
@@ -475,9 +471,8 @@ struct AP32WithCallback {
typedef CompactSizeClassMap SizeClassMap;
static const uptr kRegionSizeLog = ::kRegionSizeLog;
using AddressSpaceView = AddressSpaceViewTy;
- using ByteMap = FlatByteMap<kFlatByteMapSize, AddressSpaceView>;
typedef TestMapUnmapCallback MapUnmapCallback;
- static const uptr kFlags = SizeClassAllocator32FlagMasks::kForTest;
+ static const uptr kFlags = 0;
};
TEST(SanitizerCommon, SizeClassAllocator32MapUnmapCallback) {
OpenPOWER on IntegriCloud