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

Side by Side Diff: runtime/vm/pages.h

Issue 1119403003: Propagate failures from VirtualMemory::Commit. (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 5 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 | runtime/vm/pages.cc » ('j') | runtime/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/lockers.h" 10 #include "vm/lockers.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 static intptr_t ObjectStartOffset() { 62 static intptr_t ObjectStartOffset() {
63 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment); 63 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment);
64 } 64 }
65 65
66 private: 66 private:
67 void set_object_end(uword val) { 67 void set_object_end(uword val) {
68 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset); 68 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
69 object_end_ = val; 69 object_end_ = val;
70 } 70 }
71 71
72 // These return NULL on OOM.
72 static HeapPage* Initialize(VirtualMemory* memory, PageType type); 73 static HeapPage* Initialize(VirtualMemory* memory, PageType type);
73 static HeapPage* Allocate(intptr_t size_in_words, PageType type); 74 static HeapPage* Allocate(intptr_t size_in_words, PageType type);
74 75
75 // Deallocate the virtual memory backing this page. The page pointer to this 76 // Deallocate the virtual memory backing this page. The page pointer to this
76 // page becomes immediately inaccessible. 77 // page becomes immediately inaccessible.
77 void Deallocate(); 78 void Deallocate();
78 79
79 VirtualMemory* memory_; 80 VirtualMemory* memory_;
80 HeapPage* next_; 81 HeapPage* next_;
81 uword object_end_; 82 uword object_end_;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 friend class ExclusiveLargePageIterator; 433 friend class ExclusiveLargePageIterator;
433 friend class PageSpaceController; 434 friend class PageSpaceController;
434 friend class SweeperTask; 435 friend class SweeperTask;
435 436
436 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); 437 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
437 }; 438 };
438 439
439 } // namespace dart 440 } // namespace dart
440 441
441 #endif // VM_PAGES_H_ 442 #endif // VM_PAGES_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698