diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-11-19 10:51:42 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-11-19 13:45:08 -0800 |
commit | 7247af507f8e2218e73379ded5b2c4bbdd2a56c7 (patch) | |
tree | b859cf3e5516cd78f5f2798b2eb7dd1a11976f42 | |
parent | 017ff871ba476e21949f3b48751bf4453220cbc5 (diff) | |
download | art-7247af507f8e2218e73379ded5b2c4bbdd2a56c7.zip art-7247af507f8e2218e73379ded5b2c4bbdd2a56c7.tar.gz art-7247af507f8e2218e73379ded5b2c4bbdd2a56c7.tar.bz2 |
Fix zygote space and non moving space map names
Space names:
"non moving space" -> "zygote space"
"alloc space" -> "non moving space"
Bug: 18447855
Change-Id: Ia937b6d046ccf7f66bf1f6bbb9f17a5e0d00c016
(cherry picked from commit c5d085c955244be1743c33227384e5b62076b8bd)
-rw-r--r-- | runtime/gc/heap.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 3f747ee..0cceaa4 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -96,6 +96,8 @@ static const size_t kDefaultMarkStackSize = 64 * KB; static const char* kDlMallocSpaceName[2] = {"main dlmalloc space", "main dlmalloc space 1"}; static const char* kRosAllocSpaceName[2] = {"main rosalloc space", "main rosalloc space 1"}; static const char* kMemMapSpaceName[2] = {"main space", "main space 1"}; +static const char* kNonMovingSpaceName = "non moving space"; +static const char* kZygoteSpaceName = "zygote space"; static constexpr size_t kGSSBumpPointerSpaceCapacity = 32 * MB; Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max_free, @@ -258,10 +260,14 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max std::string error_str; std::unique_ptr<MemMap> non_moving_space_mem_map; if (separate_non_moving_space) { + // If we are the zygote, the non moving space becomes the zygote space when we run + // PreZygoteFork the first time. In this case, call the map "zygote space" since we can't + // rename the mem map later. + const char* space_name = is_zygote ? kZygoteSpaceName: kNonMovingSpaceName; // Reserve the non moving mem map before the other two since it needs to be at a specific // address. non_moving_space_mem_map.reset( - MemMap::MapAnonymous("non moving space", requested_alloc_space_begin, + MemMap::MapAnonymous(space_name, requested_alloc_space_begin, non_moving_space_capacity, PROT_READ | PROT_WRITE, true, &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. @@ -1976,7 +1982,8 @@ void Heap::PreZygoteFork() { // from this point on. RemoveRememberedSet(old_alloc_space); } - zygote_space_ = old_alloc_space->CreateZygoteSpace("alloc space", low_memory_mode_, + // Remaining space becomes the new non moving space. + zygote_space_ = old_alloc_space->CreateZygoteSpace(kNonMovingSpaceName, low_memory_mode_, &non_moving_space_); CHECK(!non_moving_space_->CanMoveObjects()); if (same_space) { |