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

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

Issue 9317054: Fix for issue r1469: DartVM appears to not GC closure reachable memory properly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | tests/language/src/GCTest.dart » ('j') | 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return addr; 66 return addr;
67 } 67 }
68 return AllocateOld(size); 68 return AllocateOld(size);
69 } 69 }
70 70
71 71
72 uword Heap::AllocateOld(intptr_t size) { 72 uword Heap::AllocateOld(intptr_t size) {
73 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0); 73 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0);
74 uword addr = old_space_->TryAllocate(size); 74 uword addr = old_space_->TryAllocate(size);
75 if (addr == 0) { 75 if (addr == 0) {
76 CollectGarbage(kOld); 76 CollectAllGarbage();
77 if (FLAG_verbose_gc) { 77 if (FLAG_verbose_gc) {
78 OS::PrintErr("New space (%dk) Old space (%dk) Code space (%dk)\n", 78 OS::PrintErr("New space (%dk) Old space (%dk) Code space (%dk)\n",
79 (new_space_->in_use() / KB), 79 (new_space_->in_use() / KB),
80 (old_space_->in_use() / KB), 80 (old_space_->in_use() / KB),
81 (code_space_->in_use() / KB)); 81 (code_space_->in_use() / KB));
82 } 82 }
83 addr = old_space_->TryAllocate(size); 83 addr = old_space_->TryAllocate(size);
84 } 84 }
85 return addr; 85 return addr;
86 } 86 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 isolate()->IncrementNoGCScopeDepth(); 187 isolate()->IncrementNoGCScopeDepth();
188 } 188 }
189 189
190 190
191 NoGCScope::~NoGCScope() { 191 NoGCScope::~NoGCScope() {
192 isolate()->DecrementNoGCScopeDepth(); 192 isolate()->DecrementNoGCScopeDepth();
193 } 193 }
194 #endif // defined(DEBUG) 194 #endif // defined(DEBUG)
195 195
196 } // namespace dart 196 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/src/GCTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698