summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-02-20 18:45:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-20 18:45:31 +0000
commit146a13d789af7246328c7af838e2ba52a7cd7bdd (patch)
tree77d696b1bcc0e4c97f03917dfb79a68b462cdcf6 /runtime/gc
parenta5a3f03405e33edb5c73cb4aa58fb09fb46318f3 (diff)
parentfef16adc09a26aa8081c3e803bbc66e1947a97a0 (diff)
downloadart-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.cc11
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;