diff options
Diffstat (limited to 'runtime/gc/space/dlmalloc_space.cc')
-rw-r--r-- | runtime/gc/space/dlmalloc_space.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc index 468d1d2..8c13d79 100644 --- a/runtime/gc/space/dlmalloc_space.cc +++ b/runtime/gc/space/dlmalloc_space.cc @@ -183,11 +183,12 @@ DlMallocSpace* DlMallocSpace::Create(const std::string& name, size_t initial_siz growth_limit = RoundUp(growth_limit, kPageSize); capacity = RoundUp(capacity, kPageSize); + std::string error_msg; UniquePtr<MemMap> mem_map(MemMap::MapAnonymous(name.c_str(), requested_begin, capacity, - PROT_READ | PROT_WRITE)); + PROT_READ | PROT_WRITE, &error_msg)); if (mem_map.get() == NULL) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " - << PrettySize(capacity); + << PrettySize(capacity) << ": " << error_msg; return NULL; } @@ -307,7 +308,10 @@ DlMallocSpace* DlMallocSpace::CreateZygoteSpace(const char* alloc_space_name) { VLOG(heap) << "Size " << GetMemMap()->Size(); VLOG(heap) << "GrowthLimit " << PrettySize(growth_limit); VLOG(heap) << "Capacity " << PrettySize(capacity); - UniquePtr<MemMap> mem_map(MemMap::MapAnonymous(alloc_space_name, End(), capacity, PROT_READ | PROT_WRITE)); + std::string error_msg; + UniquePtr<MemMap> mem_map(MemMap::MapAnonymous(alloc_space_name, End(), capacity, + PROT_READ | PROT_WRITE, &error_msg)); + CHECK(mem_map.get() != nullptr) << error_msg; void* mspace = CreateMallocSpace(end_, starting_size, initial_size); // Protect memory beyond the initial size. byte* end = mem_map->Begin() + starting_size; |