OLD | NEW |
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 VM_FREELIST_H_ | 5 #ifndef VM_FREELIST_H_ |
6 #define VM_FREELIST_H_ | 6 #define 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" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 private: | 86 private: |
87 static const int kNumLists = 128; | 87 static const int kNumLists = 128; |
88 | 88 |
89 static intptr_t IndexForSize(intptr_t size); | 89 static intptr_t IndexForSize(intptr_t size); |
90 | 90 |
91 void EnqueueElement(FreeListElement* element, intptr_t index); | 91 void EnqueueElement(FreeListElement* element, intptr_t index); |
92 FreeListElement* DequeueElement(intptr_t index); | 92 FreeListElement* DequeueElement(intptr_t index); |
93 | 93 |
94 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size); | 94 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size); |
95 | 95 |
96 BitSet<kNumLists + 1> free_map_; | 96 BitSet<kNumLists> free_map_; |
97 | 97 |
98 FreeListElement* free_lists_[kNumLists + 1]; | 98 FreeListElement* free_lists_[kNumLists + 1]; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(FreeList); | 100 DISALLOW_COPY_AND_ASSIGN(FreeList); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace dart | 103 } // namespace dart |
104 | 104 |
105 #endif // VM_FREELIST_H_ | 105 #endif // VM_FREELIST_H_ |
OLD | NEW |