Chromium Code Reviews| Index: src/heap/spaces.cc |
| diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
| index 604d32152f1356678f856ba2e4f6df2b92201436..e13f0891733b323954f5a4552933f6fa92c5c772 100644 |
| --- a/src/heap/spaces.cc |
| +++ b/src/heap/spaces.cc |
| @@ -459,7 +459,10 @@ Address MemoryAllocator::AllocateAlignedMemory( |
| DCHECK(commit_size <= reserve_size); |
| base::VirtualMemory reservation; |
| Address base = ReserveAlignedMemory(reserve_size, alignment, &reservation); |
| - if (base == NULL) return NULL; |
| + if (base == NULL) { |
| + size_.Decrement(reserve_size); |
|
Michael Lippautz
2016/10/13 08:24:36
IIUC ReserveAlignedMemory only increments if it su
Ilija.Pavlovic1
2016/10/13 12:29:58
This Decrement will be removed.
Done.
|
| + return NULL; |
| + } |
| if (executable == EXECUTABLE) { |
| if (!CommitExecutableMemory(&reservation, base, commit_size, |
| @@ -478,6 +481,7 @@ Address MemoryAllocator::AllocateAlignedMemory( |
| // Failed to commit the body. Release the mapping and any partially |
| // commited regions inside it. |
| reservation.Release(); |
| + size_.Decrement(reserve_size); |
| return NULL; |
| } |