OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_SPLAY_TREE_H_ | 5 #ifndef V8_SPLAY_TREE_H_ |
6 #define V8_SPLAY_TREE_H_ | 6 #define V8_SPLAY_TREE_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 17 matching lines...) Expand all Loading... |
28 // template <typename Config, class Allocator = FreeStoreAllocationPolicy> | 28 // template <typename Config, class Allocator = FreeStoreAllocationPolicy> |
29 // class SplayTree; | 29 // class SplayTree; |
30 template <typename Config, class AllocationPolicy> | 30 template <typename Config, class AllocationPolicy> |
31 class SplayTree { | 31 class SplayTree { |
32 public: | 32 public: |
33 typedef typename Config::Key Key; | 33 typedef typename Config::Key Key; |
34 typedef typename Config::Value Value; | 34 typedef typename Config::Value Value; |
35 | 35 |
36 class Locator; | 36 class Locator; |
37 | 37 |
38 SplayTree(AllocationPolicy allocator = AllocationPolicy()) | 38 explicit SplayTree(AllocationPolicy allocator = AllocationPolicy()) |
39 : root_(NULL), allocator_(allocator) { } | 39 : root_(NULL), allocator_(allocator) {} |
40 ~SplayTree(); | 40 ~SplayTree(); |
41 | 41 |
42 INLINE(void* operator new(size_t size, | 42 INLINE(void* operator new(size_t size, |
43 AllocationPolicy allocator = AllocationPolicy())) { | 43 AllocationPolicy allocator = AllocationPolicy())) { |
44 return allocator.New(static_cast<int>(size)); | 44 return allocator.New(static_cast<int>(size)); |
45 } | 45 } |
46 INLINE(void operator delete(void* p)) { | 46 INLINE(void operator delete(void* p)) { |
47 AllocationPolicy::Delete(p); | 47 AllocationPolicy::Delete(p); |
48 } | 48 } |
49 // Please the MSVC compiler. We should never have to execute this. | 49 // Please the MSVC compiler. We should never have to execute this. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 Node* root_; | 194 Node* root_; |
195 AllocationPolicy allocator_; | 195 AllocationPolicy allocator_; |
196 | 196 |
197 DISALLOW_COPY_AND_ASSIGN(SplayTree); | 197 DISALLOW_COPY_AND_ASSIGN(SplayTree); |
198 }; | 198 }; |
199 | 199 |
200 | 200 |
201 } } // namespace v8::internal | 201 } } // namespace v8::internal |
202 | 202 |
203 #endif // V8_SPLAY_TREE_H_ | 203 #endif // V8_SPLAY_TREE_H_ |
OLD | NEW |