diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2014-02-25 20:09:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-02-25 20:09:49 +0000 |
commit | 0f8aa6b38f204ccacd3ac12bb844e628cec2215b (patch) | |
tree | 1eb278a7636f9541825be523f1217399d195dadc | |
parent | a028595f52b61e855d6dcf75f6bdf129d5568895 (diff) | |
parent | 385de73a252806b212028c4aaccb86c296f2facc (diff) | |
download | art-0f8aa6b38f204ccacd3ac12bb844e628cec2215b.zip art-0f8aa6b38f204ccacd3ac12bb844e628cec2215b.tar.gz art-0f8aa6b38f204ccacd3ac12bb844e628cec2215b.tar.bz2 |
Merge "Fix the memory protection issue in RosAllocSpace::CreateFromMemMap()"
-rw-r--r-- | runtime/gc/space/dlmalloc_space.cc | 6 | ||||
-rw-r--r-- | runtime/gc/space/rosalloc_space.cc | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc index 931ed21..1493019 100644 --- a/runtime/gc/space/dlmalloc_space.cc +++ b/runtime/gc/space/dlmalloc_space.cc @@ -53,10 +53,10 @@ DlMallocSpace* DlMallocSpace::CreateFromMemMap(MemMap* mem_map, const std::strin return nullptr; } - // Protect memory beyond the initial size. + // Protect memory beyond the starting size. morecore will add r/w permissions when necessory byte* end = mem_map->Begin() + starting_size; - if (capacity - initial_size > 0) { - CHECK_MEMORY_CALL(mprotect, (end, capacity - initial_size, PROT_NONE), name); + if (capacity - starting_size > 0) { + CHECK_MEMORY_CALL(mprotect, (end, capacity - starting_size, PROT_NONE), name); } // Everything is set so record in immutable structure and leave diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc index 86e441e..cc6c1d9 100644 --- a/runtime/gc/space/rosalloc_space.cc +++ b/runtime/gc/space/rosalloc_space.cc @@ -56,10 +56,10 @@ RosAllocSpace* RosAllocSpace::CreateFromMemMap(MemMap* mem_map, const std::strin return NULL; } - // Protect memory beyond the initial size. + // Protect memory beyond the starting size. MoreCore will add r/w permissions when necessory byte* end = mem_map->Begin() + starting_size; - if (capacity - initial_size > 0) { - CHECK_MEMORY_CALL(mprotect, (end, capacity - initial_size, PROT_NONE), name); + if (capacity - starting_size > 0) { + CHECK_MEMORY_CALL(mprotect, (end, capacity - starting_size, PROT_NONE), name); } // Everything is set so record in immutable structure and leave |