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

Unified Diff: runtime/vm/pages.cc

Issue 11564015: Never try to add 0 bytes to free list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add {} Created 8 years 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: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 503d2b2d6a2be765ba4c897e2ebcc63475d83eaa..0aca3477a69152c206791224f90ddbe05b1ba7c3 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -220,7 +220,10 @@ uword PageSpace::TryAllocate(intptr_t size,
result = page->object_start();
// Enqueue the remainder in the free list.
uword free_start = result + size;
- freelist_[type].Free(free_start, page->object_end() - free_start);
+ intptr_t free_size = page->object_end() - free_start;
+ if (free_size > 0) {
+ freelist_[type].Free(free_start, free_size);
+ }
}
} else {
// Large page allocation.
« 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