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

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

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/freelist.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 #ifndef RUNTIME_VM_FREELIST_H_ 5 #ifndef RUNTIME_VM_FREELIST_H_
6 #define RUNTIME_VM_FREELIST_H_ 6 #define RUNTIME_VM_FREELIST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/bit_set.h" 10 #include "vm/bit_set.h"
11 #include "vm/os_thread.h"
11 #include "vm/raw_object.h" 12 #include "vm/raw_object.h"
12 #include "vm/os_thread.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 // FreeListElement describes a freelist element. Smallest FreeListElement is 16 // FreeListElement describes a freelist element. Smallest FreeListElement is
17 // two words in size. Second word of the raw object is used to keep a next_ 17 // two words in size. Second word of the raw object is used to keep a next_
18 // pointer to chain elements of the list together. For objects larger than the 18 // pointer to chain elements of the list together. For objects larger than the
19 // object size encodable in tags field, the size of the element is embedded in 19 // object size encodable in tags field, the size of the element is embedded in
20 // the element at the address following the next_ field. All words written by 20 // the element at the address following the next_ field. All words written by
21 // the freelist are guaranteed to look like Smis. 21 // the freelist are guaranteed to look like Smis.
22 // A FreeListElement never has its header mark bit set. 22 // A FreeListElement never has its header mark bit set.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 uword addr = reinterpret_cast<uword>(&next_) + kWordSize; 67 uword addr = reinterpret_cast<uword>(&next_) + kWordSize;
68 return reinterpret_cast<intptr_t*>(addr); 68 return reinterpret_cast<intptr_t*>(addr);
69 } 69 }
70 70
71 // FreeListElements cannot be allocated. Instead references to them are 71 // FreeListElements cannot be allocated. Instead references to them are
72 // created using the AsElement factory method. 72 // created using the AsElement factory method.
73 DISALLOW_ALLOCATION(); 73 DISALLOW_ALLOCATION();
74 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeListElement); 74 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeListElement);
75 }; 75 };
76 76
77
78 class FreeList { 77 class FreeList {
79 public: 78 public:
80 FreeList(); 79 FreeList();
81 ~FreeList(); 80 ~FreeList();
82 81
83 uword TryAllocate(intptr_t size, bool is_protected); 82 uword TryAllocate(intptr_t size, bool is_protected);
84 void Free(uword addr, intptr_t size); 83 void Free(uword addr, intptr_t size);
85 84
86 void Reset(); 85 void Reset();
87 86
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 127
129 // The largest available small size in bytes, or negative if there is none. 128 // The largest available small size in bytes, or negative if there is none.
130 intptr_t last_free_small_size_; 129 intptr_t last_free_small_size_;
131 130
132 DISALLOW_COPY_AND_ASSIGN(FreeList); 131 DISALLOW_COPY_AND_ASSIGN(FreeList);
133 }; 132 };
134 133
135 } // namespace dart 134 } // namespace dart
136 135
137 #endif // RUNTIME_VM_FREELIST_H_ 136 #endif // RUNTIME_VM_FREELIST_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/freelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698