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

Side by Side Diff: vm/pages.h

Issue 10093010: - Free completely empty pages as part of sweep. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | vm/pages.cc » ('j') | vm/pages.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_PAGES_H_ 5 #ifndef VM_PAGES_H_
6 #define VM_PAGES_H_ 6 #define VM_PAGES_H_
7 7
8 #include "vm/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/virtual_memory.h" 10 #include "vm/virtual_memory.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 static HeapPage* PageFor(RawObject* raw_obj) { 106 static HeapPage* PageFor(RawObject* raw_obj) {
107 return reinterpret_cast<HeapPage*>( 107 return reinterpret_cast<HeapPage*>(
108 RawObject::ToAddr(raw_obj) & ~(kPageSize -1)); 108 RawObject::ToAddr(raw_obj) & ~(kPageSize -1));
109 } 109 }
110 110
111 private: 111 private:
112 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); 112 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
113 113
114 void AllocatePage(); 114 void AllocatePage();
115 void FreePage(HeapPage* page, HeapPage* previous_page);
115 HeapPage* AllocateLargePage(intptr_t size); 116 HeapPage* AllocateLargePage(intptr_t size);
116 void FreeLargePage(HeapPage* page, HeapPage* previous_page); 117 void FreeLargePage(HeapPage* page, HeapPage* previous_page);
117 void FreePages(HeapPage* pages); 118 void FreePages(HeapPage* pages);
118 119
119 static intptr_t LargePageSizeFor(intptr_t size); 120 static intptr_t LargePageSizeFor(intptr_t size);
120 bool CanIncreaseCapacity(intptr_t increase) { 121 bool CanIncreaseCapacity(intptr_t increase) {
121 ASSERT(capacity_ <= max_capacity_); 122 ASSERT(capacity_ <= max_capacity_);
122 return increase <= (max_capacity_ - capacity_); 123 return increase <= (max_capacity_ - capacity_);
123 } 124 }
124 125
(...skipping 26 matching lines...) Expand all
151 152
152 // Keep track whether a MarkSweep is currently running. 153 // Keep track whether a MarkSweep is currently running.
153 bool sweeping_; 154 bool sweeping_;
154 155
155 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); 156 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
156 }; 157 };
157 158
158 } // namespace dart 159 } // namespace dart
159 160
160 #endif // VM_PAGES_H_ 161 #endif // VM_PAGES_H_
OLDNEW
« no previous file with comments | « no previous file | vm/pages.cc » ('j') | vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698