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

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

Issue 298153002: Version 1.4.1 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.4/
Patch Set: Created 6 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 | « dart/runtime/platform/thread_win.cc ('k') | dart/runtime/vm/os_win.cc » ('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/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 new_space_->AllocateExternal(size); 96 new_space_->AllocateExternal(size);
97 if (new_space_->ExternalInWords() > (FLAG_new_gen_ext_limit * MBInWords)) { 97 if (new_space_->ExternalInWords() > (FLAG_new_gen_ext_limit * MBInWords)) {
98 // Attempt to free some external allocation by a scavenge. (If the total 98 // Attempt to free some external allocation by a scavenge. (If the total
99 // remains above the limit, next external alloc will trigger another.) 99 // remains above the limit, next external alloc will trigger another.)
100 CollectGarbage(kNew); 100 CollectGarbage(kNew);
101 } 101 }
102 } else { 102 } else {
103 ASSERT(space == kOld); 103 ASSERT(space == kOld);
104 old_space_->AllocateExternal(size); 104 old_space_->AllocateExternal(size);
105 if (old_space_->NeedsGarbageCollection()) { 105 if (old_space_->NeedsGarbageCollection()) {
106 CollectGarbage(kOld); 106 CollectAllGarbage();
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 void Heap::FreeExternal(intptr_t size, Space space) { 111 void Heap::FreeExternal(intptr_t size, Space space) {
112 if (space == kNew) { 112 if (space == kNew) {
113 new_space_->FreeExternal(size); 113 new_space_->FreeExternal(size);
114 } else { 114 } else {
115 ASSERT(space == kOld); 115 ASSERT(space == kOld);
116 old_space_->FreeExternal(size); 116 old_space_->FreeExternal(size);
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 heap->DisableGrowthControl(); 578 heap->DisableGrowthControl();
579 } 579 }
580 580
581 581
582 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { 582 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
583 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); 583 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
584 heap->SetGrowthControlState(current_growth_controller_state_); 584 heap->SetGrowthControlState(current_growth_controller_state_);
585 } 585 }
586 586
587 } // namespace dart 587 } // namespace dart
OLDNEW
« no previous file with comments | « dart/runtime/platform/thread_win.cc ('k') | dart/runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698