diff options
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/accounting/atomic_stack.h | 4 | ||||
-rw-r--r-- | runtime/gc/accounting/bitmap.cc | 3 | ||||
-rw-r--r-- | runtime/gc/accounting/card_table.cc | 2 | ||||
-rw-r--r-- | runtime/gc/accounting/read_barrier_table.h | 2 | ||||
-rw-r--r-- | runtime/gc/accounting/space_bitmap.cc | 3 | ||||
-rw-r--r-- | runtime/gc/allocator/rosalloc.cc | 5 | ||||
-rw-r--r-- | runtime/gc/collector/mark_sweep.cc | 2 | ||||
-rw-r--r-- | runtime/gc/heap.cc | 5 | ||||
-rw-r--r-- | runtime/gc/space/bump_pointer_space.cc | 3 | ||||
-rw-r--r-- | runtime/gc/space/large_object_space.cc | 13 | ||||
-rw-r--r-- | runtime/gc/space/malloc_space.cc | 2 | ||||
-rw-r--r-- | runtime/gc/space/region_space.cc | 3 |
12 files changed, 27 insertions, 20 deletions
diff --git a/runtime/gc/accounting/atomic_stack.h b/runtime/gc/accounting/atomic_stack.h index 72734e95ac..5224d64efc 100644 --- a/runtime/gc/accounting/atomic_stack.h +++ b/runtime/gc/accounting/atomic_stack.h @@ -236,8 +236,8 @@ class AtomicStack { // Size in number of elements. void Init() { std::string error_msg; - mem_map_.reset(MemMap::MapAnonymous(name_.c_str(), NULL, capacity_ * sizeof(begin_[0]), - PROT_READ | PROT_WRITE, false, &error_msg)); + mem_map_.reset(MemMap::MapAnonymous(name_.c_str(), nullptr, capacity_ * sizeof(begin_[0]), + PROT_READ | PROT_WRITE, false, false, &error_msg)); CHECK(mem_map_.get() != NULL) << "couldn't allocate mark stack.\n" << error_msg; uint8_t* addr = mem_map_->Begin(); CHECK(addr != NULL); diff --git a/runtime/gc/accounting/bitmap.cc b/runtime/gc/accounting/bitmap.cc index de47f6094e..20984fda96 100644 --- a/runtime/gc/accounting/bitmap.cc +++ b/runtime/gc/accounting/bitmap.cc @@ -40,7 +40,8 @@ MemMap* Bitmap::AllocateMemMap(const std::string& name, size_t num_bits) { RoundUp(num_bits, kBitsPerBitmapWord) / kBitsPerBitmapWord * sizeof(uintptr_t), kPageSize); std::string error_msg; std::unique_ptr<MemMap> mem_map(MemMap::MapAnonymous(name.c_str(), nullptr, bitmap_size, - PROT_READ | PROT_WRITE, false, &error_msg)); + PROT_READ | PROT_WRITE, false, false, + &error_msg)); if (UNLIKELY(mem_map.get() == nullptr)) { LOG(ERROR) << "Failed to allocate bitmap " << name << ": " << error_msg; return nullptr; diff --git a/runtime/gc/accounting/card_table.cc b/runtime/gc/accounting/card_table.cc index ca1e7c1316..ad1f192dd6 100644 --- a/runtime/gc/accounting/card_table.cc +++ b/runtime/gc/accounting/card_table.cc @@ -62,7 +62,7 @@ CardTable* CardTable::Create(const uint8_t* heap_begin, size_t heap_capacity) { std::string error_msg; std::unique_ptr<MemMap> mem_map( MemMap::MapAnonymous("card table", nullptr, capacity + 256, PROT_READ | PROT_WRITE, - false, &error_msg)); + false, false, &error_msg)); CHECK(mem_map.get() != NULL) << "couldn't allocate card table: " << error_msg; // All zeros is the correct initial value; all clean. Anonymous mmaps are initialized to zero, we // don't clear the card table to avoid unnecessary pages being allocated diff --git a/runtime/gc/accounting/read_barrier_table.h b/runtime/gc/accounting/read_barrier_table.h index 84d5da3ba7..bb9aae7886 100644 --- a/runtime/gc/accounting/read_barrier_table.h +++ b/runtime/gc/accounting/read_barrier_table.h @@ -37,7 +37,7 @@ class ReadBarrierTable { static_cast<uint64_t>(static_cast<size_t>(kHeapCapacity / kRegionSize))); std::string error_msg; MemMap* mem_map = MemMap::MapAnonymous("read barrier table", nullptr, capacity, - PROT_READ | PROT_WRITE, false, &error_msg); + PROT_READ | PROT_WRITE, false, false, &error_msg); CHECK(mem_map != nullptr && mem_map->Begin() != nullptr) << "couldn't allocate read barrier table: " << error_msg; mem_map_.reset(mem_map); diff --git a/runtime/gc/accounting/space_bitmap.cc b/runtime/gc/accounting/space_bitmap.cc index f5d3b47d49..ad8d9884ec 100644 --- a/runtime/gc/accounting/space_bitmap.cc +++ b/runtime/gc/accounting/space_bitmap.cc @@ -63,7 +63,8 @@ SpaceBitmap<kAlignment>* SpaceBitmap<kAlignment>::Create( const size_t bitmap_size = ComputeBitmapSize(heap_capacity); std::string error_msg; std::unique_ptr<MemMap> mem_map(MemMap::MapAnonymous(name.c_str(), nullptr, bitmap_size, - PROT_READ | PROT_WRITE, false, &error_msg)); + PROT_READ | PROT_WRITE, false, false, + &error_msg)); if (UNLIKELY(mem_map.get() == nullptr)) { LOG(ERROR) << "Failed to allocate bitmap " << name << ": " << error_msg; return nullptr; diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc index 72aacf5157..f51093aa57 100644 --- a/runtime/gc/allocator/rosalloc.cc +++ b/runtime/gc/allocator/rosalloc.cc @@ -80,8 +80,9 @@ RosAlloc::RosAlloc(void* base, size_t capacity, size_t max_capacity, size_t num_of_pages = footprint_ / kPageSize; size_t max_num_of_pages = max_capacity_ / kPageSize; std::string error_msg; - page_map_mem_map_.reset(MemMap::MapAnonymous("rosalloc page map", NULL, RoundUp(max_num_of_pages, kPageSize), - PROT_READ | PROT_WRITE, false, &error_msg)); + page_map_mem_map_.reset(MemMap::MapAnonymous("rosalloc page map", nullptr, + RoundUp(max_num_of_pages, kPageSize), + PROT_READ | PROT_WRITE, false, false, &error_msg)); CHECK(page_map_mem_map_.get() != nullptr) << "Couldn't allocate the page map : " << error_msg; page_map_ = page_map_mem_map_->Begin(); page_map_size_ = num_of_pages; diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index cd63d2646b..8aac484f7f 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -106,7 +106,7 @@ MarkSweep::MarkSweep(Heap* heap, bool is_concurrent, const std::string& name_pre MemMap* mem_map = MemMap::MapAnonymous( "mark sweep sweep array free buffer", nullptr, RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), kPageSize), - PROT_READ | PROT_WRITE, false, &error_msg); + PROT_READ | PROT_WRITE, false, false, &error_msg); CHECK(mem_map != nullptr) << "Couldn't allocate sweep array free buffer: " << error_msg; sweep_array_free_buffer_mem_map_.reset(mem_map); } diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index a4bc941a60..9343622fda 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -284,7 +284,8 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max // address. non_moving_space_mem_map.reset( MemMap::MapAnonymous(space_name, requested_alloc_space_begin, - non_moving_space_capacity, PROT_READ | PROT_WRITE, true, &error_str)); + non_moving_space_capacity, PROT_READ | PROT_WRITE, true, false, + &error_str)); CHECK(non_moving_space_mem_map != nullptr) << error_str; // Try to reserve virtual memory at a lower address if we have a separate non moving space. request_begin = reinterpret_cast<uint8_t*>(300 * MB); @@ -476,7 +477,7 @@ MemMap* Heap::MapAnonymousPreferredAddress(const char* name, uint8_t* request_be size_t capacity, std::string* out_error_str) { while (true) { MemMap* map = MemMap::MapAnonymous(name, request_begin, capacity, - PROT_READ | PROT_WRITE, true, out_error_str); + PROT_READ | PROT_WRITE, true, false, out_error_str); if (map != nullptr || request_begin == nullptr) { return map; } diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc index 9675ba6f50..fbfc4495e0 100644 --- a/runtime/gc/space/bump_pointer_space.cc +++ b/runtime/gc/space/bump_pointer_space.cc @@ -29,7 +29,8 @@ BumpPointerSpace* BumpPointerSpace::Create(const std::string& name, size_t capac capacity = RoundUp(capacity, kPageSize); std::string error_msg; std::unique_ptr<MemMap> mem_map(MemMap::MapAnonymous(name.c_str(), requested_begin, capacity, - PROT_READ | PROT_WRITE, true, &error_msg)); + PROT_READ | PROT_WRITE, true, false, + &error_msg)); if (mem_map.get() == nullptr) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " << PrettySize(capacity) << " with message " << error_msg; diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc index c0c6444306..7523de58bf 100644 --- a/runtime/gc/space/large_object_space.cc +++ b/runtime/gc/space/large_object_space.cc @@ -110,8 +110,8 @@ LargeObjectMapSpace* LargeObjectMapSpace::Create(const std::string& name) { mirror::Object* LargeObjectMapSpace::Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) { std::string error_msg; - MemMap* mem_map = MemMap::MapAnonymous("large object space allocation", NULL, num_bytes, - PROT_READ | PROT_WRITE, true, &error_msg); + MemMap* mem_map = MemMap::MapAnonymous("large object space allocation", nullptr, num_bytes, + PROT_READ | PROT_WRITE, true, false, &error_msg); if (UNLIKELY(mem_map == NULL)) { LOG(WARNING) << "Large object allocation failed: " << error_msg; return NULL; @@ -291,7 +291,7 @@ FreeListSpace* FreeListSpace::Create(const std::string& name, uint8_t* requested CHECK_EQ(size % kAlignment, 0U); std::string error_msg; MemMap* mem_map = MemMap::MapAnonymous(name.c_str(), requested_begin, size, - PROT_READ | PROT_WRITE, true, &error_msg); + PROT_READ | PROT_WRITE, true, false, &error_msg); CHECK(mem_map != NULL) << "Failed to allocate large object space mem map: " << error_msg; return new FreeListSpace(name, mem_map, mem_map->Begin(), mem_map->End()); } @@ -305,9 +305,10 @@ FreeListSpace::FreeListSpace(const std::string& name, MemMap* mem_map, uint8_t* CHECK_ALIGNED(space_capacity, kAlignment); const size_t alloc_info_size = sizeof(AllocationInfo) * (space_capacity / kAlignment); std::string error_msg; - allocation_info_map_.reset(MemMap::MapAnonymous("large object free list space allocation info map", - nullptr, alloc_info_size, PROT_READ | PROT_WRITE, - false, &error_msg)); + allocation_info_map_.reset( + MemMap::MapAnonymous("large object free list space allocation info map", + nullptr, alloc_info_size, PROT_READ | PROT_WRITE, + false, false, &error_msg)); CHECK(allocation_info_map_.get() != nullptr) << "Failed to allocate allocation info map" << error_msg; allocation_info_ = reinterpret_cast<AllocationInfo*>(allocation_info_map_->Begin()); diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc index 9bbbb3cbdf..67e8847acd 100644 --- a/runtime/gc/space/malloc_space.cc +++ b/runtime/gc/space/malloc_space.cc @@ -90,7 +90,7 @@ MemMap* MallocSpace::CreateMemMap(const std::string& name, size_t starting_size, std::string error_msg; MemMap* mem_map = MemMap::MapAnonymous(name.c_str(), requested_begin, *capacity, - PROT_READ | PROT_WRITE, true, &error_msg); + PROT_READ | PROT_WRITE, true, false, &error_msg); if (mem_map == nullptr) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " << PrettySize(*capacity) << ": " << error_msg; diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc index 2c556d9ff7..8bb73d614c 100644 --- a/runtime/gc/space/region_space.cc +++ b/runtime/gc/space/region_space.cc @@ -33,7 +33,8 @@ RegionSpace* RegionSpace::Create(const std::string& name, size_t capacity, capacity = RoundUp(capacity, kRegionSize); std::string error_msg; std::unique_ptr<MemMap> mem_map(MemMap::MapAnonymous(name.c_str(), requested_begin, capacity, - PROT_READ | PROT_WRITE, true, &error_msg)); + PROT_READ | PROT_WRITE, true, false, + &error_msg)); if (mem_map.get() == nullptr) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " << PrettySize(capacity) << " with message " << error_msg; |