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

Side by Side Diff: runtime/vm/heap.cc

Issue 10375046: Add requested allocation size information to fatal error when heap is exhausted. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/compiler_stats.h" 9 #include "vm/compiler_stats.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 OS::PrintErr("New space (%dk) Old space (%dk) " 86 OS::PrintErr("New space (%dk) Old space (%dk) "
87 "Code space (%dk) Stub Code space(%dk)\n", 87 "Code space (%dk) Stub Code space(%dk)\n",
88 (new_space_->in_use() / KB), 88 (new_space_->in_use() / KB),
89 (old_space_->in_use() / KB), 89 (old_space_->in_use() / KB),
90 (code_space_->in_use() / KB), 90 (code_space_->in_use() / KB),
91 (stub_code_space_->in_use() / KB)); 91 (stub_code_space_->in_use() / KB));
92 } 92 }
93 addr = old_space_->TryAllocate(size); 93 addr = old_space_->TryAllocate(size);
94 if (addr == 0) { 94 if (addr == 0) {
95 // TODO(cshapiro): Support possible heap growth and OOM exception. 95 // TODO(cshapiro): Support possible heap growth and OOM exception.
96 FATAL("Exhausted heap space."); 96 FATAL1("Exhausted heap space, trying to allocate %d bytes.", size);
97 } 97 }
98 } 98 }
99 return addr; 99 return addr;
100 } 100 }
101 101
102 102
103 uword Heap::AllocateCode(PageSpace* space, intptr_t size) { 103 uword Heap::AllocateCode(PageSpace* space, intptr_t size) {
104 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0); 104 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0);
105 ASSERT(Utils::IsAligned(size, OS::PreferredCodeAlignment())); 105 ASSERT(Utils::IsAligned(size, OS::PreferredCodeAlignment()));
106 uword addr = space->TryAllocate(size); 106 uword addr = space->TryAllocate(size);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 isolate()->IncrementNoGCScopeDepth(); 249 isolate()->IncrementNoGCScopeDepth();
250 } 250 }
251 251
252 252
253 NoGCScope::~NoGCScope() { 253 NoGCScope::~NoGCScope() {
254 isolate()->DecrementNoGCScopeDepth(); 254 isolate()->DecrementNoGCScopeDepth();
255 } 255 }
256 #endif // defined(DEBUG) 256 #endif // defined(DEBUG)
257 257
258 } // namespace dart 258 } // namespace dart
OLDNEW
« 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