Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "malloc_space.h" |
| 18 | |
Mathieu Chartier | ec05007 | 2014-01-07 16:00:07 -0800 | [diff] [blame] | 19 | #include "gc/accounting/card_table-inl.h" |
| 20 | #include "gc/accounting/space_bitmap-inl.h" |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 21 | #include "gc/heap.h" |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 22 | #include "gc/space/space-inl.h" |
| 23 | #include "gc/space/zygote_space.h" |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 24 | #include "mirror/class-inl.h" |
| 25 | #include "mirror/object-inl.h" |
| 26 | #include "runtime.h" |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 27 | #include "handle_scope-inl.h" |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 28 | #include "thread.h" |
| 29 | #include "thread_list.h" |
| 30 | #include "utils.h" |
| 31 | |
| 32 | namespace art { |
| 33 | namespace gc { |
| 34 | namespace space { |
| 35 | |
| 36 | size_t MallocSpace::bitmap_index_ = 0; |
| 37 | |
| 38 | MallocSpace::MallocSpace(const std::string& name, MemMap* mem_map, |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 39 | uint8_t* begin, uint8_t* end, uint8_t* limit, size_t growth_limit, |
Mathieu Chartier | 31f4414 | 2014-04-08 14:40:03 -0700 | [diff] [blame] | 40 | bool create_bitmaps, bool can_move_objects, size_t starting_size, |
| 41 | size_t initial_size) |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 42 | : ContinuousMemMapAllocSpace(name, mem_map, begin, end, limit, kGcRetentionPolicyAlwaysCollect), |
| 43 | recent_free_pos_(0), lock_("allocation space lock", kAllocSpaceLock), |
Mathieu Chartier | 31f4414 | 2014-04-08 14:40:03 -0700 | [diff] [blame] | 44 | growth_limit_(growth_limit), can_move_objects_(can_move_objects), |
| 45 | starting_size_(starting_size), initial_size_(initial_size) { |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 46 | if (create_bitmaps) { |
| 47 | size_t bitmap_index = bitmap_index_++; |
| 48 | static const uintptr_t kGcCardSize = static_cast<uintptr_t>(accounting::CardTable::kCardSize); |
Roland Levillain | 14d9057 | 2015-07-16 10:52:26 +0100 | [diff] [blame] | 49 | CHECK_ALIGNED(reinterpret_cast<uintptr_t>(mem_map->Begin()), kGcCardSize); |
| 50 | CHECK_ALIGNED(reinterpret_cast<uintptr_t>(mem_map->End()), kGcCardSize); |
Mathieu Chartier | a8e8f9c | 2014-04-09 14:51:05 -0700 | [diff] [blame] | 51 | live_bitmap_.reset(accounting::ContinuousSpaceBitmap::Create( |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 52 | StringPrintf("allocspace %s live-bitmap %d", name.c_str(), static_cast<int>(bitmap_index)), |
Hiroshi Yamauchi | 447a914 | 2014-05-23 21:27:30 -0700 | [diff] [blame] | 53 | Begin(), NonGrowthLimitCapacity())); |
Mathieu Chartier | 2796a16 | 2014-07-25 11:50:47 -0700 | [diff] [blame] | 54 | CHECK(live_bitmap_.get() != nullptr) << "could not create allocspace live bitmap #" |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 55 | << bitmap_index; |
Mathieu Chartier | a8e8f9c | 2014-04-09 14:51:05 -0700 | [diff] [blame] | 56 | mark_bitmap_.reset(accounting::ContinuousSpaceBitmap::Create( |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 57 | StringPrintf("allocspace %s mark-bitmap %d", name.c_str(), static_cast<int>(bitmap_index)), |
Hiroshi Yamauchi | 447a914 | 2014-05-23 21:27:30 -0700 | [diff] [blame] | 58 | Begin(), NonGrowthLimitCapacity())); |
Nicolas Geoffray | 0c3c266 | 2015-10-15 13:53:04 +0100 | [diff] [blame] | 59 | CHECK(mark_bitmap_.get() != nullptr) << "could not create allocspace mark bitmap #" |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 60 | << bitmap_index; |
| 61 | } |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 62 | for (auto& freed : recent_freed_objects_) { |
| 63 | freed.first = nullptr; |
| 64 | freed.second = nullptr; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | MemMap* MallocSpace::CreateMemMap(const std::string& name, size_t starting_size, size_t* initial_size, |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 69 | size_t* growth_limit, size_t* capacity, uint8_t* requested_begin) { |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 70 | // Sanity check arguments |
| 71 | if (starting_size > *initial_size) { |
| 72 | *initial_size = starting_size; |
| 73 | } |
| 74 | if (*initial_size > *growth_limit) { |
| 75 | LOG(ERROR) << "Failed to create alloc space (" << name << ") where the initial size (" |
| 76 | << PrettySize(*initial_size) << ") is larger than its capacity (" |
| 77 | << PrettySize(*growth_limit) << ")"; |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 78 | return nullptr; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 79 | } |
| 80 | if (*growth_limit > *capacity) { |
| 81 | LOG(ERROR) << "Failed to create alloc space (" << name << ") where the growth limit capacity (" |
| 82 | << PrettySize(*growth_limit) << ") is larger than the capacity (" |
| 83 | << PrettySize(*capacity) << ")"; |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 84 | return nullptr; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | // Page align growth limit and capacity which will be used to manage mmapped storage |
| 88 | *growth_limit = RoundUp(*growth_limit, kPageSize); |
| 89 | *capacity = RoundUp(*capacity, kPageSize); |
| 90 | |
| 91 | std::string error_msg; |
| 92 | MemMap* mem_map = MemMap::MapAnonymous(name.c_str(), requested_begin, *capacity, |
Vladimir Marko | 5c42c29 | 2015-02-25 12:02:49 +0000 | [diff] [blame] | 93 | PROT_READ | PROT_WRITE, true, false, &error_msg); |
Mathieu Chartier | e6da9af | 2013-12-16 11:54:42 -0800 | [diff] [blame] | 94 | if (mem_map == nullptr) { |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 95 | LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " |
| 96 | << PrettySize(*capacity) << ": " << error_msg; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 97 | } |
| 98 | return mem_map; |
| 99 | } |
| 100 | |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 101 | mirror::Class* MallocSpace::FindRecentFreedObject(const mirror::Object* obj) { |
| 102 | size_t pos = recent_free_pos_; |
| 103 | // Start at the most recently freed object and work our way back since there may be duplicates |
| 104 | // caused by dlmalloc reusing memory. |
| 105 | if (kRecentFreeCount > 0) { |
| 106 | for (size_t i = 0; i + 1 < kRecentFreeCount + 1; ++i) { |
| 107 | pos = pos != 0 ? pos - 1 : kRecentFreeMask; |
| 108 | if (recent_freed_objects_[pos].first == obj) { |
| 109 | return recent_freed_objects_[pos].second; |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | return nullptr; |
| 114 | } |
| 115 | |
| 116 | void MallocSpace::RegisterRecentFree(mirror::Object* ptr) { |
Mathieu Chartier | 4e30541 | 2014-02-19 10:54:44 -0800 | [diff] [blame] | 117 | // No verification since the object is dead. |
| 118 | recent_freed_objects_[recent_free_pos_] = std::make_pair(ptr, ptr->GetClass<kVerifyNone>()); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 119 | recent_free_pos_ = (recent_free_pos_ + 1) & kRecentFreeMask; |
| 120 | } |
| 121 | |
| 122 | void MallocSpace::SetGrowthLimit(size_t growth_limit) { |
| 123 | growth_limit = RoundUp(growth_limit, kPageSize); |
| 124 | growth_limit_ = growth_limit; |
| 125 | if (Size() > growth_limit_) { |
Ian Rogers | be2a1df | 2014-07-10 00:56:36 -0700 | [diff] [blame] | 126 | SetEnd(begin_ + growth_limit); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | |
| 130 | void* MallocSpace::MoreCore(intptr_t increment) { |
| 131 | CheckMoreCoreForPrecondition(); |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 132 | uint8_t* original_end = End(); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 133 | if (increment != 0) { |
| 134 | VLOG(heap) << "MallocSpace::MoreCore " << PrettySize(increment); |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 135 | uint8_t* new_end = original_end + increment; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 136 | if (increment > 0) { |
| 137 | // Should never be asked to increase the allocation beyond the capacity of the space. Enforced |
| 138 | // by mspace_set_footprint_limit. |
| 139 | CHECK_LE(new_end, Begin() + Capacity()); |
| 140 | CHECK_MEMORY_CALL(mprotect, (original_end, increment, PROT_READ | PROT_WRITE), GetName()); |
| 141 | } else { |
| 142 | // Should never be asked for negative footprint (ie before begin). Zero footprint is ok. |
| 143 | CHECK_GE(original_end + increment, Begin()); |
| 144 | // Advise we don't need the pages and protect them |
| 145 | // TODO: by removing permissions to the pages we may be causing TLB shoot-down which can be |
| 146 | // expensive (note the same isn't true for giving permissions to a page as the protected |
| 147 | // page shouldn't be in a TLB). We should investigate performance impact of just |
| 148 | // removing ignoring the memory protection change here and in Space::CreateAllocSpace. It's |
| 149 | // likely just a useful debug feature. |
| 150 | size_t size = -increment; |
| 151 | CHECK_MEMORY_CALL(madvise, (new_end, size, MADV_DONTNEED), GetName()); |
| 152 | CHECK_MEMORY_CALL(mprotect, (new_end, size, PROT_NONE), GetName()); |
| 153 | } |
Ian Rogers | be2a1df | 2014-07-10 00:56:36 -0700 | [diff] [blame] | 154 | // Update end_. |
| 155 | SetEnd(new_end); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 156 | } |
| 157 | return original_end; |
| 158 | } |
| 159 | |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 160 | ZygoteSpace* MallocSpace::CreateZygoteSpace(const char* alloc_space_name, bool low_memory_mode, |
| 161 | MallocSpace** out_malloc_space) { |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 162 | // For RosAlloc, revoke thread local runs before creating a new |
| 163 | // alloc space so that we won't mix thread local runs from different |
| 164 | // alloc spaces. |
| 165 | RevokeAllThreadLocalBuffers(); |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 166 | SetEnd(reinterpret_cast<uint8_t*>(RoundUp(reinterpret_cast<uintptr_t>(End()), kPageSize))); |
Roland Levillain | 14d9057 | 2015-07-16 10:52:26 +0100 | [diff] [blame] | 167 | DCHECK_ALIGNED(begin_, accounting::CardTable::kCardSize); |
| 168 | DCHECK_ALIGNED(End(), accounting::CardTable::kCardSize); |
| 169 | DCHECK_ALIGNED(begin_, kPageSize); |
| 170 | DCHECK_ALIGNED(End(), kPageSize); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 171 | size_t size = RoundUp(Size(), kPageSize); |
Mathieu Chartier | 85a43c0 | 2014-01-07 17:59:00 -0800 | [diff] [blame] | 172 | // Trimming the heap should be done by the caller since we may have invalidated the accounting |
| 173 | // stored in between objects. |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 174 | // Remaining size is for the new alloc space. |
| 175 | const size_t growth_limit = growth_limit_ - size; |
Lin Zang | d0e0d4c | 2014-12-12 21:54:47 +0800 | [diff] [blame] | 176 | // Use mem map limit in case error for clear growth limit. |
| 177 | const size_t capacity = NonGrowthLimitCapacity() - size; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 178 | VLOG(heap) << "Begin " << reinterpret_cast<const void*>(begin_) << "\n" |
Ian Rogers | be2a1df | 2014-07-10 00:56:36 -0700 | [diff] [blame] | 179 | << "End " << reinterpret_cast<const void*>(End()) << "\n" |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 180 | << "Size " << size << "\n" |
| 181 | << "GrowthLimit " << growth_limit_ << "\n" |
| 182 | << "Capacity " << Capacity(); |
| 183 | SetGrowthLimit(RoundUp(size, kPageSize)); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 184 | // FIXME: Do we need reference counted pointers here? |
| 185 | // Make the two spaces share the same mark bitmaps since the bitmaps span both of the spaces. |
| 186 | VLOG(heap) << "Creating new AllocSpace: "; |
| 187 | VLOG(heap) << "Size " << GetMemMap()->Size(); |
| 188 | VLOG(heap) << "GrowthLimit " << PrettySize(growth_limit); |
| 189 | VLOG(heap) << "Capacity " << PrettySize(capacity); |
| 190 | // Remap the tail. |
| 191 | std::string error_msg; |
Ian Rogers | be2a1df | 2014-07-10 00:56:36 -0700 | [diff] [blame] | 192 | std::unique_ptr<MemMap> mem_map(GetMemMap()->RemapAtEnd(End(), alloc_space_name, |
| 193 | PROT_READ | PROT_WRITE, &error_msg)); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 194 | CHECK(mem_map.get() != nullptr) << error_msg; |
Ian Rogers | be2a1df | 2014-07-10 00:56:36 -0700 | [diff] [blame] | 195 | void* allocator = CreateAllocator(End(), starting_size_, initial_size_, capacity, |
| 196 | low_memory_mode); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 197 | // Protect memory beyond the initial size. |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 198 | uint8_t* end = mem_map->Begin() + starting_size_; |
Mathieu Chartier | c4d095b | 2014-04-15 12:01:58 -0700 | [diff] [blame] | 199 | if (capacity > initial_size_) { |
| 200 | CHECK_MEMORY_CALL(mprotect, (end, capacity - initial_size_, PROT_NONE), alloc_space_name); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 201 | } |
Andreas Gampe | d757632 | 2014-10-24 22:13:45 -0700 | [diff] [blame] | 202 | *out_malloc_space = CreateInstance(mem_map.release(), alloc_space_name, allocator, End(), end, |
Mathieu Chartier | 31f4414 | 2014-04-08 14:40:03 -0700 | [diff] [blame] | 203 | limit_, growth_limit, CanMoveObjects()); |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 204 | SetLimit(End()); |
| 205 | live_bitmap_->SetHeapLimit(reinterpret_cast<uintptr_t>(End())); |
| 206 | CHECK_EQ(live_bitmap_->HeapLimit(), reinterpret_cast<uintptr_t>(End())); |
| 207 | mark_bitmap_->SetHeapLimit(reinterpret_cast<uintptr_t>(End())); |
| 208 | CHECK_EQ(mark_bitmap_->HeapLimit(), reinterpret_cast<uintptr_t>(End())); |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 209 | |
| 210 | // Create the actual zygote space. |
| 211 | ZygoteSpace* zygote_space = ZygoteSpace::Create("Zygote space", ReleaseMemMap(), |
| 212 | live_bitmap_.release(), mark_bitmap_.release()); |
| 213 | if (UNLIKELY(zygote_space == nullptr)) { |
| 214 | VLOG(heap) << "Failed creating zygote space from space " << GetName(); |
| 215 | } else { |
| 216 | VLOG(heap) << "zygote space creation done"; |
| 217 | } |
| 218 | return zygote_space; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | void MallocSpace::Dump(std::ostream& os) const { |
| 222 | os << GetType() |
Hiroshi Yamauchi | 447a914 | 2014-05-23 21:27:30 -0700 | [diff] [blame] | 223 | << " begin=" << reinterpret_cast<void*>(Begin()) |
| 224 | << ",end=" << reinterpret_cast<void*>(End()) |
| 225 | << ",limit=" << reinterpret_cast<void*>(Limit()) |
| 226 | << ",size=" << PrettySize(Size()) << ",capacity=" << PrettySize(Capacity()) |
| 227 | << ",non_growth_limit_capacity=" << PrettySize(NonGrowthLimitCapacity()) |
| 228 | << ",name=\"" << GetName() << "\"]"; |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 229 | } |
| 230 | |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 231 | void MallocSpace::SweepCallback(size_t num_ptrs, mirror::Object** ptrs, void* arg) { |
Mathieu Chartier | ec05007 | 2014-01-07 16:00:07 -0800 | [diff] [blame] | 232 | SweepCallbackContext* context = static_cast<SweepCallbackContext*>(arg); |
Mathieu Chartier | a1602f2 | 2014-01-13 17:19:19 -0800 | [diff] [blame] | 233 | space::MallocSpace* space = context->space->AsMallocSpace(); |
Mathieu Chartier | ec05007 | 2014-01-07 16:00:07 -0800 | [diff] [blame] | 234 | Thread* self = context->self; |
| 235 | Locks::heap_bitmap_lock_->AssertExclusiveHeld(self); |
| 236 | // If the bitmaps aren't swapped we need to clear the bits since the GC isn't going to re-swap |
| 237 | // the bitmaps as an optimization. |
| 238 | if (!context->swap_bitmaps) { |
Mathieu Chartier | a8e8f9c | 2014-04-09 14:51:05 -0700 | [diff] [blame] | 239 | accounting::ContinuousSpaceBitmap* bitmap = space->GetLiveBitmap(); |
Mathieu Chartier | ec05007 | 2014-01-07 16:00:07 -0800 | [diff] [blame] | 240 | for (size_t i = 0; i < num_ptrs; ++i) { |
| 241 | bitmap->Clear(ptrs[i]); |
| 242 | } |
| 243 | } |
| 244 | // Use a bulk free, that merges consecutive objects before freeing or free per object? |
| 245 | // Documentation suggests better free performance with merging, but this may be at the expensive |
| 246 | // of allocation. |
Mathieu Chartier | 10fb83a | 2014-06-15 15:15:43 -0700 | [diff] [blame] | 247 | context->freed.objects += num_ptrs; |
| 248 | context->freed.bytes += space->FreeList(self, num_ptrs, ptrs); |
Mathieu Chartier | ec05007 | 2014-01-07 16:00:07 -0800 | [diff] [blame] | 249 | } |
| 250 | |
Mathieu Chartier | 379d09f | 2015-01-08 11:28:13 -0800 | [diff] [blame] | 251 | void MallocSpace::ClampGrowthLimit() { |
| 252 | size_t new_capacity = Capacity(); |
| 253 | CHECK_LE(new_capacity, NonGrowthLimitCapacity()); |
| 254 | GetLiveBitmap()->SetHeapSize(new_capacity); |
| 255 | GetMarkBitmap()->SetHeapSize(new_capacity); |
Mathieu Chartier | ddac423 | 2015-04-02 10:08:03 -0700 | [diff] [blame] | 256 | if (temp_bitmap_.get() != nullptr) { |
| 257 | // If the bitmaps are clamped, then the temp bitmap is actually the mark bitmap. |
| 258 | temp_bitmap_->SetHeapSize(new_capacity); |
| 259 | } |
Mathieu Chartier | 379d09f | 2015-01-08 11:28:13 -0800 | [diff] [blame] | 260 | GetMemMap()->SetSize(new_capacity); |
| 261 | limit_ = Begin() + new_capacity; |
Mathieu Chartier | 379d09f | 2015-01-08 11:28:13 -0800 | [diff] [blame] | 262 | } |
| 263 | |
Hiroshi Yamauchi | cf58d4a | 2013-09-26 14:21:22 -0700 | [diff] [blame] | 264 | } // namespace space |
| 265 | } // namespace gc |
| 266 | } // namespace art |