OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 bool prev_; | 157 bool prev_; |
158 }; | 158 }; |
159 | 159 |
160 | 160 |
161 // The ZoneListAllocationPolicy is used to specialize the GenericList | 161 // The ZoneListAllocationPolicy is used to specialize the GenericList |
162 // implementation to allocate ZoneLists and their elements in the | 162 // implementation to allocate ZoneLists and their elements in the |
163 // Zone. | 163 // Zone. |
164 class ZoneListAllocationPolicy { | 164 class ZoneListAllocationPolicy { |
165 public: | 165 public: |
166 // Allocate 'size' bytes of memory in the zone. | 166 // Allocate 'size' bytes of memory in the zone. |
167 INLINE(static void* New(int size)); | 167 static void* New(int size); |
168 | 168 |
169 // De-allocation attempts are silently ignored. | 169 // De-allocation attempts are silently ignored. |
170 static void Delete(void* p) { } | 170 static void Delete(void* p) { } |
171 }; | 171 }; |
172 | 172 |
173 | 173 |
174 // ZoneLists are growable lists with constant-time access to the | 174 // ZoneLists are growable lists with constant-time access to the |
175 // elements. The list itself and all its elements are allocated in the | 175 // elements. The list itself and all its elements are allocated in the |
176 // Zone. ZoneLists cannot be deleted individually; you can delete all | 176 // Zone. ZoneLists cannot be deleted individually; you can delete all |
177 // objects in the Zone by calling Zone::DeleteAll(). | 177 // objects in the Zone by calling Zone::DeleteAll(). |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 public: | 231 public: |
232 ZoneSplayTree() | 232 ZoneSplayTree() |
233 : SplayTree<Config, ZoneListAllocationPolicy>() {} | 233 : SplayTree<Config, ZoneListAllocationPolicy>() {} |
234 ~ZoneSplayTree(); | 234 ~ZoneSplayTree(); |
235 }; | 235 }; |
236 | 236 |
237 | 237 |
238 } } // namespace v8::internal | 238 } } // namespace v8::internal |
239 | 239 |
240 #endif // V8_ZONE_H_ | 240 #endif // V8_ZONE_H_ |
OLD | NEW |