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

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: 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..ac5f412645d47dea7c8bd439659c69d8b763c23c 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -220,7 +220,8 @@ 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);
Ivan Posva 2012/12/13 14:45:20 {} please.
}
} 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