[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}
This commit is contained in:
parent
0ddddcb862
commit
b7dae10e5b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user