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

Unified Diff: runtime/vm/pages.cc

Issue 805413002: Check for OOM in HeapPage::Allocate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
===================================================================
--- runtime/vm/pages.cc (revision 42408)
+++ runtime/vm/pages.cc (working copy)
@@ -61,6 +61,10 @@
HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) {
VirtualMemory* memory =
VerifiedMemory::Reserve(size_in_words << kWordSizeLog2);
+ if (memory == NULL) {
+ FATAL1("Out of memory while allocating %" Pd " words.\n",
+ size_in_words);
+ }
return Initialize(memory, type);
}
@@ -1001,7 +1005,7 @@
return 0;
} else {
ASSERT(total_time >= gc_time);
- int result= static_cast<int>((static_cast<double>(gc_time) /
+ int result = static_cast<int>((static_cast<double>(gc_time) /
static_cast<double>(total_time)) * 100);
Ivan Posva 2014/12/17 01:27:38 Weird indent.
koda 2014/12/17 01:43:08 Done.
return result;
}
« 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