Commit 9cb42010 authored by Ilija.Pavlovic's avatar Ilija.Pavlovic Committed by Commit bot

[heap] Fix MemoryAllocator::AllocateAlignedMemory.

AllocateAlignedMemory calls ReserveAlignedMemory which increments size_
value. In some cases AllocateAlignedMemory can return NULL value. Before
returning NULL, AllocateAlignedMemory should decrease size_ value.

TEST=cctest/test-spaces/LargeObjectSpace
BUG=

Review-Url: https://codereview.chromium.org/2418733002
Cr-Commit-Position: refs/heads/master@{#40262}
parent 74158b00
......@@ -478,6 +478,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment