summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/tests
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2016-08-24 17:40:29 +0000
committerVitaly Buka <vitalybuka@google.com>2016-08-24 17:40:29 +0000
commit41eabf5ccff29b99228414e892311592ae3aa1fa (patch)
tree4028843d0fcfd013b45df951d126761b03204403 /lib/sanitizer_common/tests
parente84c21ca6b5611cd392d32bab6dad1a06589b57d (diff)
Revert r279572 "[sanitizer] change the 64-bit..." because of failures on ubsan
This reverts commit r279572 and r279595. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/tests')
-rw-r--r--lib/sanitizer_common/tests/sanitizer_allocator_test.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_allocator_test.cc b/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
index 08bca919c..a558f0836 100644
--- a/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
+++ b/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
@@ -99,10 +99,8 @@ void TestSizeClassAllocator() {
memset(&cache, 0, sizeof(cache));
cache.Init(0);
- static const uptr sizes[] = {
- 1, 16, 30, 40, 100, 1000, 10000,
- 50000, 60000, 100000, 120000, 300000, 500000, 1000000, 2000000
- };
+ static const uptr sizes[] = {1, 16, 30, 40, 100, 1000, 10000,
+ 50000, 60000, 100000, 120000, 300000, 500000, 1000000, 2000000};
std::vector<void *> allocated;
@@ -302,11 +300,8 @@ TEST(SanitizerCommon, SizeClassAllocator64MapUnmapCallback) {
cache.Init(0);
AllocatorStats stats;
stats.Init();
- const size_t kNumChunks = 128;
- uint32_t chunks[kNumChunks];
- a->GetFromAllocator(&stats, 32, chunks, kNumChunks);
- // State + alloc + metadata + freearray.
- EXPECT_EQ(TestMapUnmapCallback::map_count, 4);
+ a->AllocateBatch(&stats, &cache, 32);
+ EXPECT_EQ(TestMapUnmapCallback::map_count, 3); // State + alloc + metadata.
a->TestOnlyUnmap();
EXPECT_EQ(TestMapUnmapCallback::unmap_count, 1); // The whole thing.
delete a;
@@ -365,10 +360,8 @@ void FailInAssertionOnOOM() {
cache.Init(0);
AllocatorStats stats;
stats.Init();
- const size_t kNumChunks = 128;
- uint32_t chunks[kNumChunks];
for (int i = 0; i < 1000000; i++) {
- a.GetFromAllocator(&stats, 52, chunks, kNumChunks);
+ a.AllocateBatch(&stats, &cache, 52);
}
a.TestOnlyUnmap();