diff options
author | Andreas Gampe <agampe@google.com> | 2015-02-20 18:45:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-20 18:45:31 +0000 |
commit | 146a13d789af7246328c7af838e2ba52a7cd7bdd (patch) | |
tree | 77d696b1bcc0e4c97f03917dfb79a68b462cdcf6 /runtime/gc | |
parent | a5a3f03405e33edb5c73cb4aa58fb09fb46318f3 (diff) | |
parent | fef16adc09a26aa8081c3e803bbc66e1947a97a0 (diff) | |
download | art-146a13d789af7246328c7af838e2ba52a7cd7bdd.zip art-146a13d789af7246328c7af838e2ba52a7cd7bdd.tar.gz art-146a13d789af7246328c7af838e2ba52a7cd7bdd.tar.bz2 |
Merge "ART: Fix RosAlloc Valgrind code"
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/allocator/rosalloc.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc index 7996241..72aacf5 100644 --- a/runtime/gc/allocator/rosalloc.cc +++ b/runtime/gc/allocator/rosalloc.cc @@ -1889,6 +1889,9 @@ void RosAlloc::Verify() { MutexLock lock_mu(self, lock_); size_t pm_end = page_map_size_; size_t i = 0; + size_t valgrind_modifier = running_on_valgrind_ ? + 2 * ::art::gc::space::kDefaultValgrindRedZoneBytes : // Redzones before and after. + 0; while (i < pm_end) { uint8_t pm = page_map_[i]; switch (pm) { @@ -1932,12 +1935,10 @@ void RosAlloc::Verify() { } mirror::Object* obj = reinterpret_cast<mirror::Object*>(start); size_t obj_size = obj->SizeOf(); - CHECK_GT(obj_size + - (running_on_valgrind_ ? 2 * ::art::gc::space::kDefaultValgrindRedZoneBytes : 0), - kLargeSizeThreshold) + CHECK_GT(obj_size + valgrind_modifier, kLargeSizeThreshold) << "A rosalloc large object size must be > " << kLargeSizeThreshold; - CHECK_EQ(num_pages, RoundUp(obj_size, kPageSize) / kPageSize) - << "A rosalloc large object size " << obj_size + CHECK_EQ(num_pages, RoundUp(obj_size + valgrind_modifier, kPageSize) / kPageSize) + << "A rosalloc large object size " << obj_size + valgrind_modifier << " does not match the page map table " << (num_pages * kPageSize) << std::endl << DumpPageMap(); i += num_pages; |