Commit b7dae10e authored by ulan's avatar ulan Committed by Commit bot

[heap] Add debug checks for linear allocation area top and limit.

BUG=chromium:659165

Review-Url: https://codereview.chromium.org/2455103002
Cr-Commit-Position: refs/heads/master@{#40629}
parent 0ddddcb8
......@@ -2563,6 +2563,13 @@ FreeSpace* FreeList::FindNodeFor(size_t size_in_bytes, size_t* node_size) {
HeapObject* FreeList::Allocate(size_t size_in_bytes) {
DCHECK(size_in_bytes <= kMaxBlockSize);
DCHECK(IsAligned(size_in_bytes, kPointerSize));
DCHECK_LE(owner_->top(), owner_->limit());
#ifdef DEBUG
if (owner_->top() != owner_->limit()) {
DCHECK_EQ(Page::FromAddress(owner_->top()),
Page::FromAddress(owner_->limit() - 1));
}
#endif
// Don't free list allocate if there is linear space available.
DCHECK_LT(static_cast<size_t>(owner_->limit() - owner_->top()),
size_in_bytes);
......
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