diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-02-05 02:45:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-05 02:45:26 +0000 |
commit | 7e6a918ecfbe786c060bce0eeddd55c4c70f819d (patch) | |
tree | a9dbe25c726afd48de6b06ac7aeb0bd2e9656943 | |
parent | 19929654ddf3bce1b89db92a9b7fb47d6e91e2f8 (diff) | |
parent | c38c5ea76dd3cfd44eec21df640161046ffc3e4c (diff) | |
download | art-7e6a918ecfbe786c060bce0eeddd55c4c70f819d.zip art-7e6a918ecfbe786c060bce0eeddd55c4c70f819d.tar.gz art-7e6a918ecfbe786c060bce0eeddd55c4c70f819d.tar.bz2 |
Merge "Clear thread local freed bits in RosAlloc::Run::InspectAllSlots"
-rw-r--r-- | runtime/gc/allocator/rosalloc.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc index 7c2474f..7996241 100644 --- a/runtime/gc/allocator/rosalloc.cc +++ b/runtime/gc/allocator/rosalloc.cc @@ -1119,12 +1119,19 @@ void RosAlloc::Run::InspectAllSlots(void (*handler)(void* start, void* end, size uint8_t* slot_base = reinterpret_cast<uint8_t*>(this) + headerSizes[idx]; size_t num_slots = numOfSlots[idx]; size_t bracket_size = IndexToBracketSize(idx); - DCHECK_EQ(slot_base + num_slots * bracket_size, reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * kPageSize); + DCHECK_EQ(slot_base + num_slots * bracket_size, + reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * kPageSize); size_t num_vec = RoundUp(num_slots, 32) / 32; size_t slots = 0; + const uint32_t* const tl_free_vecp = IsThreadLocal() ? ThreadLocalFreeBitMap() : nullptr; for (size_t v = 0; v < num_vec; v++, slots += 32) { DCHECK_GE(num_slots, slots); uint32_t vec = alloc_bit_map_[v]; + if (tl_free_vecp != nullptr) { + // Clear out the set bits in the thread local free bitmap since these aren't actually + // allocated. + vec &= ~tl_free_vecp[v]; + } size_t end = std::min(num_slots - slots, static_cast<size_t>(32)); for (size_t i = 0; i < end; ++i) { bool is_allocated = ((vec >> i) & 0x1) != 0; |