Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: src/heap/spaces.cc

Issue 2455103002: [heap] Add debug checks for linear allocation area top and limit. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 26b29afaeb9816397ad37fb26b671960e6510b72..17d2a70144b271c767270d2c87dbef185dec6042 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698