Chris@16
|
1
|
Chris@16
|
2 // Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
|
Chris@16
|
3 // Copyright (C) 2005-2011 Daniel James
|
Chris@16
|
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6
|
Chris@16
|
7 #ifndef BOOST_UNORDERED_DETAIL_MANAGER_HPP_INCLUDED
|
Chris@16
|
8 #define BOOST_UNORDERED_DETAIL_MANAGER_HPP_INCLUDED
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/config.hpp>
|
Chris@101
|
11 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
12 #pragma once
|
Chris@16
|
13 #endif
|
Chris@16
|
14
|
Chris@16
|
15 #include <boost/unordered/detail/util.hpp>
|
Chris@16
|
16 #include <boost/unordered/detail/allocate.hpp>
|
Chris@16
|
17 #include <boost/type_traits/aligned_storage.hpp>
|
Chris@16
|
18 #include <boost/type_traits/alignment_of.hpp>
|
Chris@16
|
19 #include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
Chris@16
|
20 #include <boost/type_traits/is_nothrow_move_assignable.hpp>
|
Chris@16
|
21 #include <boost/swap.hpp>
|
Chris@16
|
22 #include <boost/assert.hpp>
|
Chris@16
|
23 #include <boost/limits.hpp>
|
Chris@16
|
24 #include <boost/iterator.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost { namespace unordered { namespace detail {
|
Chris@16
|
27
|
Chris@16
|
28 template <typename Types> struct table;
|
Chris@16
|
29 template <typename NodePointer> struct bucket;
|
Chris@16
|
30 struct ptr_bucket;
|
Chris@16
|
31 template <typename Types> struct table_impl;
|
Chris@16
|
32 template <typename Types> struct grouped_table_impl;
|
Chris@16
|
33
|
Chris@16
|
34 }}}
|
Chris@16
|
35
|
Chris@16
|
36 // The 'iterator_detail' namespace was a misguided attempt at avoiding ADL
|
Chris@16
|
37 // in the detail namespace. It didn't work because the template parameters
|
Chris@16
|
38 // were in detail. I'm not changing it at the moment to be safe. I might
|
Chris@16
|
39 // do in the future if I change the iterator types.
|
Chris@16
|
40 namespace boost { namespace unordered { namespace iterator_detail {
|
Chris@16
|
41
|
Chris@16
|
42 ////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
43 // Iterators
|
Chris@16
|
44 //
|
Chris@16
|
45 // all no throw
|
Chris@16
|
46
|
Chris@16
|
47 template <typename Node> struct iterator;
|
Chris@101
|
48 template <typename Node> struct c_iterator;
|
Chris@16
|
49 template <typename Node, typename Policy> struct l_iterator;
|
Chris@101
|
50 template <typename Node, typename Policy>
|
Chris@16
|
51 struct cl_iterator;
|
Chris@16
|
52
|
Chris@16
|
53 // Local Iterators
|
Chris@16
|
54 //
|
Chris@16
|
55 // all no throw
|
Chris@16
|
56
|
Chris@16
|
57 template <typename Node, typename Policy>
|
Chris@16
|
58 struct l_iterator
|
Chris@16
|
59 : public boost::iterator<
|
Chris@16
|
60 std::forward_iterator_tag,
|
Chris@16
|
61 typename Node::value_type,
|
Chris@16
|
62 std::ptrdiff_t,
|
Chris@101
|
63 typename Node::value_type*,
|
Chris@16
|
64 typename Node::value_type&>
|
Chris@16
|
65 {
|
Chris@16
|
66 #if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
Chris@101
|
67 template <typename Node2, typename Policy2>
|
Chris@16
|
68 friend struct boost::unordered::iterator_detail::cl_iterator;
|
Chris@16
|
69 private:
|
Chris@16
|
70 #endif
|
Chris@16
|
71 typedef typename Node::node_pointer node_pointer;
|
Chris@101
|
72 typedef boost::unordered::iterator_detail::iterator<Node> n_iterator;
|
Chris@16
|
73 node_pointer ptr_;
|
Chris@16
|
74 std::size_t bucket_;
|
Chris@16
|
75 std::size_t bucket_count_;
|
Chris@16
|
76
|
Chris@16
|
77 public:
|
Chris@16
|
78
|
Chris@16
|
79 typedef typename Node::value_type value_type;
|
Chris@16
|
80
|
Chris@16
|
81 l_iterator() BOOST_NOEXCEPT : ptr_() {}
|
Chris@16
|
82
|
Chris@101
|
83 l_iterator(n_iterator x, std::size_t b, std::size_t c) BOOST_NOEXCEPT
|
Chris@16
|
84 : ptr_(x.node_), bucket_(b), bucket_count_(c) {}
|
Chris@16
|
85
|
Chris@16
|
86 value_type& operator*() const {
|
Chris@16
|
87 return ptr_->value();
|
Chris@16
|
88 }
|
Chris@16
|
89
|
Chris@16
|
90 value_type* operator->() const {
|
Chris@16
|
91 return ptr_->value_ptr();
|
Chris@16
|
92 }
|
Chris@16
|
93
|
Chris@16
|
94 l_iterator& operator++() {
|
Chris@16
|
95 ptr_ = static_cast<node_pointer>(ptr_->next_);
|
Chris@16
|
96 if (ptr_ && Policy::to_bucket(bucket_count_, ptr_->hash_)
|
Chris@16
|
97 != bucket_)
|
Chris@16
|
98 ptr_ = node_pointer();
|
Chris@16
|
99 return *this;
|
Chris@16
|
100 }
|
Chris@16
|
101
|
Chris@16
|
102 l_iterator operator++(int) {
|
Chris@16
|
103 l_iterator tmp(*this);
|
Chris@16
|
104 ++(*this);
|
Chris@16
|
105 return tmp;
|
Chris@16
|
106 }
|
Chris@16
|
107
|
Chris@16
|
108 bool operator==(l_iterator x) const BOOST_NOEXCEPT {
|
Chris@16
|
109 return ptr_ == x.ptr_;
|
Chris@16
|
110 }
|
Chris@16
|
111
|
Chris@16
|
112 bool operator!=(l_iterator x) const BOOST_NOEXCEPT {
|
Chris@16
|
113 return ptr_ != x.ptr_;
|
Chris@16
|
114 }
|
Chris@16
|
115 };
|
Chris@16
|
116
|
Chris@101
|
117 template <typename Node, typename Policy>
|
Chris@16
|
118 struct cl_iterator
|
Chris@16
|
119 : public boost::iterator<
|
Chris@16
|
120 std::forward_iterator_tag,
|
Chris@16
|
121 typename Node::value_type,
|
Chris@16
|
122 std::ptrdiff_t,
|
Chris@101
|
123 typename Node::value_type const*,
|
Chris@16
|
124 typename Node::value_type const&>
|
Chris@16
|
125 {
|
Chris@16
|
126 friend struct boost::unordered::iterator_detail::l_iterator
|
Chris@16
|
127 <Node, Policy>;
|
Chris@16
|
128 private:
|
Chris@16
|
129
|
Chris@16
|
130 typedef typename Node::node_pointer node_pointer;
|
Chris@101
|
131 typedef boost::unordered::iterator_detail::iterator<Node> n_iterator;
|
Chris@16
|
132 node_pointer ptr_;
|
Chris@16
|
133 std::size_t bucket_;
|
Chris@16
|
134 std::size_t bucket_count_;
|
Chris@16
|
135
|
Chris@16
|
136 public:
|
Chris@16
|
137
|
Chris@16
|
138 typedef typename Node::value_type value_type;
|
Chris@16
|
139
|
Chris@16
|
140 cl_iterator() BOOST_NOEXCEPT : ptr_() {}
|
Chris@16
|
141
|
Chris@101
|
142 cl_iterator(n_iterator x, std::size_t b, std::size_t c) BOOST_NOEXCEPT :
|
Chris@16
|
143 ptr_(x.node_), bucket_(b), bucket_count_(c) {}
|
Chris@16
|
144
|
Chris@16
|
145 cl_iterator(boost::unordered::iterator_detail::l_iterator<
|
Chris@16
|
146 Node, Policy> const& x) BOOST_NOEXCEPT :
|
Chris@16
|
147 ptr_(x.ptr_), bucket_(x.bucket_), bucket_count_(x.bucket_count_)
|
Chris@16
|
148 {}
|
Chris@16
|
149
|
Chris@16
|
150 value_type const& operator*() const {
|
Chris@16
|
151 return ptr_->value();
|
Chris@16
|
152 }
|
Chris@16
|
153
|
Chris@16
|
154 value_type const* operator->() const {
|
Chris@16
|
155 return ptr_->value_ptr();
|
Chris@16
|
156 }
|
Chris@16
|
157
|
Chris@16
|
158 cl_iterator& operator++() {
|
Chris@16
|
159 ptr_ = static_cast<node_pointer>(ptr_->next_);
|
Chris@16
|
160 if (ptr_ && Policy::to_bucket(bucket_count_, ptr_->hash_)
|
Chris@16
|
161 != bucket_)
|
Chris@16
|
162 ptr_ = node_pointer();
|
Chris@16
|
163 return *this;
|
Chris@16
|
164 }
|
Chris@16
|
165
|
Chris@16
|
166 cl_iterator operator++(int) {
|
Chris@16
|
167 cl_iterator tmp(*this);
|
Chris@16
|
168 ++(*this);
|
Chris@16
|
169 return tmp;
|
Chris@16
|
170 }
|
Chris@16
|
171
|
Chris@16
|
172 friend bool operator==(cl_iterator const& x, cl_iterator const& y)
|
Chris@16
|
173 BOOST_NOEXCEPT
|
Chris@16
|
174 {
|
Chris@16
|
175 return x.ptr_ == y.ptr_;
|
Chris@16
|
176 }
|
Chris@16
|
177
|
Chris@16
|
178 friend bool operator!=(cl_iterator const& x, cl_iterator const& y)
|
Chris@16
|
179 BOOST_NOEXCEPT
|
Chris@16
|
180 {
|
Chris@16
|
181 return x.ptr_ != y.ptr_;
|
Chris@16
|
182 }
|
Chris@16
|
183 };
|
Chris@16
|
184
|
Chris@16
|
185 template <typename Node>
|
Chris@16
|
186 struct iterator
|
Chris@16
|
187 : public boost::iterator<
|
Chris@16
|
188 std::forward_iterator_tag,
|
Chris@16
|
189 typename Node::value_type,
|
Chris@16
|
190 std::ptrdiff_t,
|
Chris@101
|
191 typename Node::value_type*,
|
Chris@16
|
192 typename Node::value_type&>
|
Chris@16
|
193 {
|
Chris@16
|
194 #if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
Chris@101
|
195 template <typename>
|
Chris@16
|
196 friend struct boost::unordered::iterator_detail::c_iterator;
|
Chris@16
|
197 template <typename, typename>
|
Chris@16
|
198 friend struct boost::unordered::iterator_detail::l_iterator;
|
Chris@101
|
199 template <typename, typename>
|
Chris@16
|
200 friend struct boost::unordered::iterator_detail::cl_iterator;
|
Chris@16
|
201 template <typename>
|
Chris@16
|
202 friend struct boost::unordered::detail::table;
|
Chris@16
|
203 template <typename>
|
Chris@16
|
204 friend struct boost::unordered::detail::table_impl;
|
Chris@16
|
205 template <typename>
|
Chris@16
|
206 friend struct boost::unordered::detail::grouped_table_impl;
|
Chris@16
|
207 private:
|
Chris@16
|
208 #endif
|
Chris@16
|
209 typedef typename Node::node_pointer node_pointer;
|
Chris@16
|
210 node_pointer node_;
|
Chris@16
|
211
|
Chris@16
|
212 public:
|
Chris@16
|
213
|
Chris@16
|
214 typedef typename Node::value_type value_type;
|
Chris@16
|
215
|
Chris@16
|
216 iterator() BOOST_NOEXCEPT : node_() {}
|
Chris@16
|
217
|
Chris@16
|
218 explicit iterator(typename Node::link_pointer x) BOOST_NOEXCEPT :
|
Chris@16
|
219 node_(static_cast<node_pointer>(x)) {}
|
Chris@16
|
220
|
Chris@16
|
221 value_type& operator*() const {
|
Chris@16
|
222 return node_->value();
|
Chris@16
|
223 }
|
Chris@16
|
224
|
Chris@16
|
225 value_type* operator->() const {
|
Chris@101
|
226 return node_->value_ptr();
|
Chris@16
|
227 }
|
Chris@16
|
228
|
Chris@16
|
229 iterator& operator++() {
|
Chris@16
|
230 node_ = static_cast<node_pointer>(node_->next_);
|
Chris@16
|
231 return *this;
|
Chris@16
|
232 }
|
Chris@16
|
233
|
Chris@16
|
234 iterator operator++(int) {
|
Chris@16
|
235 iterator tmp(node_);
|
Chris@16
|
236 node_ = static_cast<node_pointer>(node_->next_);
|
Chris@16
|
237 return tmp;
|
Chris@16
|
238 }
|
Chris@16
|
239
|
Chris@16
|
240 bool operator==(iterator const& x) const BOOST_NOEXCEPT {
|
Chris@16
|
241 return node_ == x.node_;
|
Chris@16
|
242 }
|
Chris@16
|
243
|
Chris@16
|
244 bool operator!=(iterator const& x) const BOOST_NOEXCEPT {
|
Chris@16
|
245 return node_ != x.node_;
|
Chris@16
|
246 }
|
Chris@16
|
247 };
|
Chris@16
|
248
|
Chris@101
|
249 template <typename Node>
|
Chris@16
|
250 struct c_iterator
|
Chris@16
|
251 : public boost::iterator<
|
Chris@16
|
252 std::forward_iterator_tag,
|
Chris@16
|
253 typename Node::value_type,
|
Chris@16
|
254 std::ptrdiff_t,
|
Chris@101
|
255 typename Node::value_type const*,
|
Chris@16
|
256 typename Node::value_type const&>
|
Chris@16
|
257 {
|
Chris@16
|
258 friend struct boost::unordered::iterator_detail::iterator<Node>;
|
Chris@16
|
259
|
Chris@16
|
260 #if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
Chris@16
|
261 template <typename>
|
Chris@16
|
262 friend struct boost::unordered::detail::table;
|
Chris@16
|
263 template <typename>
|
Chris@16
|
264 friend struct boost::unordered::detail::table_impl;
|
Chris@16
|
265 template <typename>
|
Chris@16
|
266 friend struct boost::unordered::detail::grouped_table_impl;
|
Chris@16
|
267
|
Chris@16
|
268 private:
|
Chris@16
|
269 #endif
|
Chris@16
|
270 typedef typename Node::node_pointer node_pointer;
|
Chris@101
|
271 typedef boost::unordered::iterator_detail::iterator<Node> n_iterator;
|
Chris@16
|
272 node_pointer node_;
|
Chris@16
|
273
|
Chris@16
|
274 public:
|
Chris@16
|
275
|
Chris@16
|
276 typedef typename Node::value_type value_type;
|
Chris@16
|
277
|
Chris@16
|
278 c_iterator() BOOST_NOEXCEPT : node_() {}
|
Chris@16
|
279
|
Chris@16
|
280 explicit c_iterator(typename Node::link_pointer x) BOOST_NOEXCEPT :
|
Chris@16
|
281 node_(static_cast<node_pointer>(x)) {}
|
Chris@16
|
282
|
Chris@101
|
283 c_iterator(n_iterator const& x) BOOST_NOEXCEPT : node_(x.node_) {}
|
Chris@16
|
284
|
Chris@16
|
285 value_type const& operator*() const {
|
Chris@16
|
286 return node_->value();
|
Chris@16
|
287 }
|
Chris@16
|
288
|
Chris@16
|
289 value_type const* operator->() const {
|
Chris@101
|
290 return node_->value_ptr();
|
Chris@16
|
291 }
|
Chris@16
|
292
|
Chris@16
|
293 c_iterator& operator++() {
|
Chris@16
|
294 node_ = static_cast<node_pointer>(node_->next_);
|
Chris@16
|
295 return *this;
|
Chris@16
|
296 }
|
Chris@16
|
297
|
Chris@16
|
298 c_iterator operator++(int) {
|
Chris@16
|
299 c_iterator tmp(node_);
|
Chris@16
|
300 node_ = static_cast<node_pointer>(node_->next_);
|
Chris@16
|
301 return tmp;
|
Chris@16
|
302 }
|
Chris@16
|
303
|
Chris@16
|
304 friend bool operator==(c_iterator const& x, c_iterator const& y)
|
Chris@16
|
305 BOOST_NOEXCEPT
|
Chris@16
|
306 {
|
Chris@16
|
307 return x.node_ == y.node_;
|
Chris@16
|
308 }
|
Chris@16
|
309
|
Chris@16
|
310 friend bool operator!=(c_iterator const& x, c_iterator const& y)
|
Chris@16
|
311 BOOST_NOEXCEPT
|
Chris@16
|
312 {
|
Chris@16
|
313 return x.node_ != y.node_;
|
Chris@16
|
314 }
|
Chris@16
|
315 };
|
Chris@16
|
316 }}}
|
Chris@16
|
317
|
Chris@16
|
318 namespace boost { namespace unordered { namespace detail {
|
Chris@16
|
319
|
Chris@16
|
320 ///////////////////////////////////////////////////////////////////
|
Chris@16
|
321 //
|
Chris@16
|
322 // Node construction
|
Chris@16
|
323
|
Chris@16
|
324 template <typename NodeAlloc>
|
Chris@16
|
325 struct node_constructor
|
Chris@16
|
326 {
|
Chris@16
|
327 private:
|
Chris@16
|
328
|
Chris@16
|
329 typedef NodeAlloc node_allocator;
|
Chris@16
|
330 typedef boost::unordered::detail::allocator_traits<NodeAlloc>
|
Chris@16
|
331 node_allocator_traits;
|
Chris@16
|
332 typedef typename node_allocator_traits::value_type node;
|
Chris@16
|
333 typedef typename node_allocator_traits::pointer node_pointer;
|
Chris@16
|
334 typedef typename node::value_type value_type;
|
Chris@16
|
335
|
Chris@16
|
336 protected:
|
Chris@16
|
337
|
Chris@16
|
338 node_allocator& alloc_;
|
Chris@16
|
339 node_pointer node_;
|
Chris@16
|
340 bool node_constructed_;
|
Chris@16
|
341 bool value_constructed_;
|
Chris@16
|
342
|
Chris@16
|
343 public:
|
Chris@16
|
344
|
Chris@16
|
345 node_constructor(node_allocator& n) :
|
Chris@16
|
346 alloc_(n),
|
Chris@16
|
347 node_(),
|
Chris@16
|
348 node_constructed_(false),
|
Chris@16
|
349 value_constructed_(false)
|
Chris@16
|
350 {
|
Chris@16
|
351 }
|
Chris@16
|
352
|
Chris@16
|
353 ~node_constructor();
|
Chris@16
|
354
|
Chris@16
|
355 void construct();
|
Chris@16
|
356
|
Chris@16
|
357 template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
|
Chris@16
|
358 void construct_with_value(BOOST_UNORDERED_EMPLACE_ARGS)
|
Chris@16
|
359 {
|
Chris@16
|
360 construct();
|
Chris@16
|
361 boost::unordered::detail::func::construct_value_impl(
|
Chris@16
|
362 alloc_, node_->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
|
Chris@16
|
363 value_constructed_ = true;
|
Chris@16
|
364 }
|
Chris@16
|
365
|
Chris@16
|
366 template <typename A0>
|
Chris@16
|
367 void construct_with_value2(BOOST_FWD_REF(A0) a0)
|
Chris@16
|
368 {
|
Chris@16
|
369 construct();
|
Chris@16
|
370 boost::unordered::detail::func::construct_value_impl(
|
Chris@16
|
371 alloc_, node_->value_ptr(),
|
Chris@16
|
372 BOOST_UNORDERED_EMPLACE_ARGS1(boost::forward<A0>(a0)));
|
Chris@16
|
373 value_constructed_ = true;
|
Chris@16
|
374 }
|
Chris@16
|
375
|
Chris@16
|
376 value_type const& value() const {
|
Chris@16
|
377 BOOST_ASSERT(node_ && node_constructed_ && value_constructed_);
|
Chris@16
|
378 return node_->value();
|
Chris@16
|
379 }
|
Chris@16
|
380
|
Chris@16
|
381 // no throw
|
Chris@16
|
382 node_pointer release()
|
Chris@16
|
383 {
|
Chris@16
|
384 BOOST_ASSERT(node_ && node_constructed_);
|
Chris@16
|
385 node_pointer p = node_;
|
Chris@16
|
386 node_ = node_pointer();
|
Chris@16
|
387 return p;
|
Chris@16
|
388 }
|
Chris@16
|
389
|
Chris@16
|
390 private:
|
Chris@16
|
391 node_constructor(node_constructor const&);
|
Chris@16
|
392 node_constructor& operator=(node_constructor const&);
|
Chris@16
|
393 };
|
Chris@16
|
394
|
Chris@16
|
395 template <typename Alloc>
|
Chris@16
|
396 node_constructor<Alloc>::~node_constructor()
|
Chris@16
|
397 {
|
Chris@16
|
398 if (node_) {
|
Chris@16
|
399 if (value_constructed_) {
|
Chris@16
|
400 boost::unordered::detail::func::destroy_value_impl(alloc_,
|
Chris@16
|
401 node_->value_ptr());
|
Chris@16
|
402 }
|
Chris@16
|
403
|
Chris@16
|
404 if (node_constructed_) {
|
Chris@101
|
405 boost::unordered::detail::func::destroy(
|
Chris@16
|
406 boost::addressof(*node_));
|
Chris@16
|
407 }
|
Chris@16
|
408
|
Chris@16
|
409 node_allocator_traits::deallocate(alloc_, node_, 1);
|
Chris@16
|
410 }
|
Chris@16
|
411 }
|
Chris@16
|
412
|
Chris@16
|
413 template <typename Alloc>
|
Chris@16
|
414 void node_constructor<Alloc>::construct()
|
Chris@16
|
415 {
|
Chris@16
|
416 if(!node_) {
|
Chris@16
|
417 node_constructed_ = false;
|
Chris@16
|
418 value_constructed_ = false;
|
Chris@16
|
419
|
Chris@16
|
420 node_ = node_allocator_traits::allocate(alloc_, 1);
|
Chris@16
|
421
|
Chris@101
|
422 new ((void*) boost::addressof(*node_)) node();
|
Chris@16
|
423 node_->init(node_);
|
Chris@16
|
424 node_constructed_ = true;
|
Chris@16
|
425 }
|
Chris@16
|
426 else {
|
Chris@16
|
427 BOOST_ASSERT(node_constructed_);
|
Chris@16
|
428
|
Chris@16
|
429 if (value_constructed_)
|
Chris@16
|
430 {
|
Chris@16
|
431 boost::unordered::detail::func::destroy_value_impl(alloc_,
|
Chris@16
|
432 node_->value_ptr());
|
Chris@16
|
433 value_constructed_ = false;
|
Chris@16
|
434 }
|
Chris@16
|
435 }
|
Chris@16
|
436 }
|
Chris@16
|
437
|
Chris@16
|
438 ///////////////////////////////////////////////////////////////////
|
Chris@16
|
439 //
|
Chris@16
|
440 // Node Holder
|
Chris@16
|
441 //
|
Chris@16
|
442 // Temporary store for nodes. Deletes any that aren't used.
|
Chris@16
|
443
|
Chris@16
|
444 template <typename NodeAlloc>
|
Chris@16
|
445 struct node_holder : private node_constructor<NodeAlloc>
|
Chris@16
|
446 {
|
Chris@16
|
447 private:
|
Chris@16
|
448 typedef node_constructor<NodeAlloc> base;
|
Chris@16
|
449
|
Chris@16
|
450 typedef NodeAlloc node_allocator;
|
Chris@16
|
451 typedef boost::unordered::detail::allocator_traits<NodeAlloc>
|
Chris@16
|
452 node_allocator_traits;
|
Chris@16
|
453 typedef typename node_allocator_traits::value_type node;
|
Chris@16
|
454 typedef typename node_allocator_traits::pointer node_pointer;
|
Chris@16
|
455 typedef typename node::value_type value_type;
|
Chris@16
|
456 typedef typename node::link_pointer link_pointer;
|
Chris@16
|
457 typedef boost::unordered::iterator_detail::iterator<node> iterator;
|
Chris@16
|
458
|
Chris@16
|
459 node_pointer nodes_;
|
Chris@16
|
460
|
Chris@16
|
461 public:
|
Chris@16
|
462
|
Chris@16
|
463 template <typename Table>
|
Chris@16
|
464 explicit node_holder(Table& b) :
|
Chris@16
|
465 base(b.node_alloc()),
|
Chris@16
|
466 nodes_()
|
Chris@16
|
467 {
|
Chris@16
|
468 if (b.size_) {
|
Chris@16
|
469 typename Table::link_pointer prev = b.get_previous_start();
|
Chris@16
|
470 nodes_ = static_cast<node_pointer>(prev->next_);
|
Chris@16
|
471 prev->next_ = link_pointer();
|
Chris@16
|
472 b.size_ = 0;
|
Chris@16
|
473 }
|
Chris@16
|
474 }
|
Chris@16
|
475
|
Chris@16
|
476 ~node_holder();
|
Chris@16
|
477
|
Chris@16
|
478 void node_for_assignment()
|
Chris@16
|
479 {
|
Chris@16
|
480 if (!this->node_ && nodes_) {
|
Chris@16
|
481 this->node_ = nodes_;
|
Chris@16
|
482 nodes_ = static_cast<node_pointer>(nodes_->next_);
|
Chris@16
|
483 this->node_->init(this->node_);
|
Chris@16
|
484 this->node_->next_ = link_pointer();
|
Chris@16
|
485
|
Chris@16
|
486 this->node_constructed_ = true;
|
Chris@16
|
487 this->value_constructed_ = true;
|
Chris@16
|
488 }
|
Chris@16
|
489 }
|
Chris@16
|
490
|
Chris@16
|
491 template <typename T>
|
Chris@16
|
492 inline void assign_impl(T const& v) {
|
Chris@16
|
493 if (this->node_ && this->value_constructed_) {
|
Chris@16
|
494 this->node_->value() = v;
|
Chris@16
|
495 }
|
Chris@16
|
496 else {
|
Chris@16
|
497 this->construct_with_value2(v);
|
Chris@16
|
498 }
|
Chris@16
|
499 }
|
Chris@16
|
500
|
Chris@16
|
501 template <typename T1, typename T2>
|
Chris@16
|
502 inline void assign_impl(std::pair<T1 const, T2> const& v) {
|
Chris@16
|
503 this->construct_with_value2(v);
|
Chris@16
|
504 }
|
Chris@16
|
505
|
Chris@16
|
506 template <typename T>
|
Chris@16
|
507 inline void move_assign_impl(T& v) {
|
Chris@16
|
508 if (this->node_ && this->value_constructed_) {
|
Chris@16
|
509 this->node_->value() = boost::move(v);
|
Chris@16
|
510 }
|
Chris@16
|
511 else {
|
Chris@16
|
512 this->construct_with_value2(boost::move(v));
|
Chris@16
|
513 }
|
Chris@16
|
514 }
|
Chris@16
|
515
|
Chris@16
|
516 template <typename T1, typename T2>
|
Chris@16
|
517 inline void move_assign_impl(std::pair<T1 const, T2>& v) {
|
Chris@16
|
518 this->construct_with_value2(boost::move(v));
|
Chris@16
|
519 }
|
Chris@16
|
520
|
Chris@16
|
521 node_pointer copy_of(value_type const& v)
|
Chris@16
|
522 {
|
Chris@16
|
523 node_for_assignment();
|
Chris@16
|
524 assign_impl(v);
|
Chris@16
|
525 return base::release();
|
Chris@16
|
526 }
|
Chris@16
|
527
|
Chris@16
|
528 node_pointer move_copy_of(value_type& v)
|
Chris@16
|
529 {
|
Chris@16
|
530 node_for_assignment();
|
Chris@16
|
531 move_assign_impl(v);
|
Chris@16
|
532 return base::release();
|
Chris@16
|
533 }
|
Chris@16
|
534
|
Chris@16
|
535 iterator begin() const
|
Chris@16
|
536 {
|
Chris@16
|
537 return iterator(nodes_);
|
Chris@16
|
538 }
|
Chris@16
|
539 };
|
Chris@16
|
540
|
Chris@16
|
541 template <typename Alloc>
|
Chris@16
|
542 node_holder<Alloc>::~node_holder()
|
Chris@16
|
543 {
|
Chris@16
|
544 while (nodes_) {
|
Chris@16
|
545 node_pointer p = nodes_;
|
Chris@16
|
546 nodes_ = static_cast<node_pointer>(p->next_);
|
Chris@16
|
547
|
Chris@16
|
548 boost::unordered::detail::func::destroy_value_impl(this->alloc_,
|
Chris@16
|
549 p->value_ptr());
|
Chris@101
|
550 boost::unordered::detail::func::destroy(boost::addressof(*p));
|
Chris@16
|
551 node_allocator_traits::deallocate(this->alloc_, p, 1);
|
Chris@16
|
552 }
|
Chris@16
|
553 }
|
Chris@16
|
554
|
Chris@16
|
555 ///////////////////////////////////////////////////////////////////
|
Chris@16
|
556 //
|
Chris@16
|
557 // Bucket
|
Chris@16
|
558
|
Chris@16
|
559 template <typename NodePointer>
|
Chris@16
|
560 struct bucket
|
Chris@16
|
561 {
|
Chris@16
|
562 typedef NodePointer link_pointer;
|
Chris@16
|
563 link_pointer next_;
|
Chris@16
|
564
|
Chris@16
|
565 bucket() : next_() {}
|
Chris@16
|
566
|
Chris@16
|
567 link_pointer first_from_start()
|
Chris@16
|
568 {
|
Chris@16
|
569 return next_;
|
Chris@16
|
570 }
|
Chris@16
|
571
|
Chris@16
|
572 enum { extra_node = true };
|
Chris@16
|
573 };
|
Chris@16
|
574
|
Chris@16
|
575 struct ptr_bucket
|
Chris@16
|
576 {
|
Chris@16
|
577 typedef ptr_bucket* link_pointer;
|
Chris@16
|
578 link_pointer next_;
|
Chris@16
|
579
|
Chris@16
|
580 ptr_bucket() : next_(0) {}
|
Chris@16
|
581
|
Chris@16
|
582 link_pointer first_from_start()
|
Chris@16
|
583 {
|
Chris@16
|
584 return this;
|
Chris@16
|
585 }
|
Chris@16
|
586
|
Chris@16
|
587 enum { extra_node = false };
|
Chris@16
|
588 };
|
Chris@16
|
589
|
Chris@16
|
590 ///////////////////////////////////////////////////////////////////
|
Chris@16
|
591 //
|
Chris@16
|
592 // Hash Policy
|
Chris@16
|
593
|
Chris@16
|
594 template <typename SizeT>
|
Chris@16
|
595 struct prime_policy
|
Chris@16
|
596 {
|
Chris@16
|
597 template <typename Hash, typename T>
|
Chris@16
|
598 static inline SizeT apply_hash(Hash const& hf, T const& x) {
|
Chris@16
|
599 return hf(x);
|
Chris@16
|
600 }
|
Chris@16
|
601
|
Chris@16
|
602 static inline SizeT to_bucket(SizeT bucket_count, SizeT hash) {
|
Chris@16
|
603 return hash % bucket_count;
|
Chris@16
|
604 }
|
Chris@16
|
605
|
Chris@16
|
606 static inline SizeT new_bucket_count(SizeT min) {
|
Chris@16
|
607 return boost::unordered::detail::next_prime(min);
|
Chris@16
|
608 }
|
Chris@16
|
609
|
Chris@16
|
610 static inline SizeT prev_bucket_count(SizeT max) {
|
Chris@16
|
611 return boost::unordered::detail::prev_prime(max);
|
Chris@16
|
612 }
|
Chris@16
|
613 };
|
Chris@16
|
614
|
Chris@16
|
615 template <typename SizeT>
|
Chris@16
|
616 struct mix64_policy
|
Chris@16
|
617 {
|
Chris@16
|
618 template <typename Hash, typename T>
|
Chris@16
|
619 static inline SizeT apply_hash(Hash const& hf, T const& x) {
|
Chris@16
|
620 SizeT key = hf(x);
|
Chris@16
|
621 key = (~key) + (key << 21); // key = (key << 21) - key - 1;
|
Chris@16
|
622 key = key ^ (key >> 24);
|
Chris@16
|
623 key = (key + (key << 3)) + (key << 8); // key * 265
|
Chris@16
|
624 key = key ^ (key >> 14);
|
Chris@16
|
625 key = (key + (key << 2)) + (key << 4); // key * 21
|
Chris@16
|
626 key = key ^ (key >> 28);
|
Chris@16
|
627 key = key + (key << 31);
|
Chris@16
|
628 return key;
|
Chris@16
|
629 }
|
Chris@16
|
630
|
Chris@16
|
631 static inline SizeT to_bucket(SizeT bucket_count, SizeT hash) {
|
Chris@16
|
632 return hash & (bucket_count - 1);
|
Chris@16
|
633 }
|
Chris@16
|
634
|
Chris@16
|
635 static inline SizeT new_bucket_count(SizeT min) {
|
Chris@16
|
636 if (min <= 4) return 4;
|
Chris@16
|
637 --min;
|
Chris@16
|
638 min |= min >> 1;
|
Chris@16
|
639 min |= min >> 2;
|
Chris@16
|
640 min |= min >> 4;
|
Chris@16
|
641 min |= min >> 8;
|
Chris@16
|
642 min |= min >> 16;
|
Chris@16
|
643 min |= min >> 32;
|
Chris@16
|
644 return min + 1;
|
Chris@16
|
645 }
|
Chris@16
|
646
|
Chris@16
|
647 static inline SizeT prev_bucket_count(SizeT max) {
|
Chris@16
|
648 max |= max >> 1;
|
Chris@16
|
649 max |= max >> 2;
|
Chris@16
|
650 max |= max >> 4;
|
Chris@16
|
651 max |= max >> 8;
|
Chris@16
|
652 max |= max >> 16;
|
Chris@16
|
653 max |= max >> 32;
|
Chris@16
|
654 return (max >> 1) + 1;
|
Chris@16
|
655 }
|
Chris@16
|
656 };
|
Chris@16
|
657
|
Chris@16
|
658 template <int digits, int radix>
|
Chris@16
|
659 struct pick_policy_impl {
|
Chris@16
|
660 typedef prime_policy<std::size_t> type;
|
Chris@16
|
661 };
|
Chris@16
|
662
|
Chris@16
|
663 template <>
|
Chris@16
|
664 struct pick_policy_impl<64, 2> {
|
Chris@16
|
665 typedef mix64_policy<std::size_t> type;
|
Chris@16
|
666 };
|
Chris@16
|
667
|
Chris@101
|
668 template <typename T>
|
Chris@16
|
669 struct pick_policy :
|
Chris@16
|
670 pick_policy_impl<
|
Chris@16
|
671 std::numeric_limits<std::size_t>::digits,
|
Chris@16
|
672 std::numeric_limits<std::size_t>::radix> {};
|
Chris@16
|
673
|
Chris@101
|
674 // While the mix policy is generally faster, the prime policy is a lot
|
Chris@101
|
675 // faster when a large number consecutive integers are used, because
|
Chris@101
|
676 // there are no collisions. Since that is probably quite common, use
|
Chris@101
|
677 // prime policy for integeral types. But not the smaller ones, as they
|
Chris@101
|
678 // don't have enough unique values for this to be an issue.
|
Chris@101
|
679
|
Chris@101
|
680 template <>
|
Chris@101
|
681 struct pick_policy<int> {
|
Chris@101
|
682 typedef prime_policy<std::size_t> type;
|
Chris@101
|
683 };
|
Chris@101
|
684
|
Chris@101
|
685 template <>
|
Chris@101
|
686 struct pick_policy<unsigned int> {
|
Chris@101
|
687 typedef prime_policy<std::size_t> type;
|
Chris@101
|
688 };
|
Chris@101
|
689
|
Chris@101
|
690 template <>
|
Chris@101
|
691 struct pick_policy<long> {
|
Chris@101
|
692 typedef prime_policy<std::size_t> type;
|
Chris@101
|
693 };
|
Chris@101
|
694
|
Chris@101
|
695 template <>
|
Chris@101
|
696 struct pick_policy<unsigned long> {
|
Chris@101
|
697 typedef prime_policy<std::size_t> type;
|
Chris@101
|
698 };
|
Chris@101
|
699
|
Chris@101
|
700 // TODO: Maybe not if std::size_t is smaller than long long.
|
Chris@101
|
701 #if !defined(BOOST_NO_LONG_LONG)
|
Chris@101
|
702 template <>
|
Chris@101
|
703 struct pick_policy<long long> {
|
Chris@101
|
704 typedef prime_policy<std::size_t> type;
|
Chris@101
|
705 };
|
Chris@101
|
706
|
Chris@101
|
707 template <>
|
Chris@101
|
708 struct pick_policy<unsigned long long> {
|
Chris@101
|
709 typedef prime_policy<std::size_t> type;
|
Chris@101
|
710 };
|
Chris@101
|
711 #endif
|
Chris@101
|
712
|
Chris@16
|
713 ////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
714 // Functions
|
Chris@16
|
715
|
Chris@16
|
716 // Assigning and swapping the equality and hash function objects
|
Chris@16
|
717 // needs strong exception safety. To implement that normally we'd
|
Chris@16
|
718 // require one of them to be known to not throw and the other to
|
Chris@16
|
719 // guarantee strong exception safety. Unfortunately they both only
|
Chris@16
|
720 // have basic exception safety. So to acheive strong exception
|
Chris@16
|
721 // safety we have storage space for two copies, and assign the new
|
Chris@16
|
722 // copies to the unused space. Then switch to using that to use
|
Chris@16
|
723 // them. This is implemented in 'set_hash_functions' which
|
Chris@16
|
724 // atomically assigns the new function objects in a strongly
|
Chris@16
|
725 // exception safe manner.
|
Chris@16
|
726
|
Chris@16
|
727 template <class H, class P, bool NoThrowMoveAssign>
|
Chris@16
|
728 class set_hash_functions;
|
Chris@16
|
729
|
Chris@16
|
730 template <class H, class P>
|
Chris@16
|
731 class functions
|
Chris@16
|
732 {
|
Chris@16
|
733 public:
|
Chris@16
|
734 static const bool nothrow_move_assignable =
|
Chris@16
|
735 boost::is_nothrow_move_assignable<H>::value &&
|
Chris@16
|
736 boost::is_nothrow_move_assignable<P>::value;
|
Chris@16
|
737 static const bool nothrow_move_constructible =
|
Chris@16
|
738 boost::is_nothrow_move_constructible<H>::value &&
|
Chris@16
|
739 boost::is_nothrow_move_constructible<P>::value;
|
Chris@16
|
740
|
Chris@16
|
741 private:
|
Chris@16
|
742 friend class boost::unordered::detail::set_hash_functions<H, P,
|
Chris@16
|
743 nothrow_move_assignable>;
|
Chris@16
|
744 functions& operator=(functions const&);
|
Chris@16
|
745
|
Chris@16
|
746 typedef compressed<H, P> function_pair;
|
Chris@16
|
747
|
Chris@16
|
748 typedef typename boost::aligned_storage<
|
Chris@16
|
749 sizeof(function_pair),
|
Chris@16
|
750 boost::alignment_of<function_pair>::value>::type aligned_function;
|
Chris@16
|
751
|
Chris@16
|
752 bool current_; // The currently active functions.
|
Chris@16
|
753 aligned_function funcs_[2];
|
Chris@16
|
754
|
Chris@16
|
755 function_pair const& current() const {
|
Chris@16
|
756 return *static_cast<function_pair const*>(
|
Chris@16
|
757 static_cast<void const*>(&funcs_[current_]));
|
Chris@16
|
758 }
|
Chris@16
|
759
|
Chris@16
|
760 function_pair& current() {
|
Chris@16
|
761 return *static_cast<function_pair*>(
|
Chris@16
|
762 static_cast<void*>(&funcs_[current_]));
|
Chris@16
|
763 }
|
Chris@16
|
764
|
Chris@16
|
765 void construct(bool which, H const& hf, P const& eq)
|
Chris@16
|
766 {
|
Chris@16
|
767 new((void*) &funcs_[which]) function_pair(hf, eq);
|
Chris@16
|
768 }
|
Chris@16
|
769
|
Chris@16
|
770 void construct(bool which, function_pair const& f,
|
Chris@16
|
771 boost::unordered::detail::false_type =
|
Chris@16
|
772 boost::unordered::detail::false_type())
|
Chris@16
|
773 {
|
Chris@16
|
774 new((void*) &funcs_[which]) function_pair(f);
|
Chris@16
|
775 }
|
Chris@16
|
776
|
Chris@16
|
777 void construct(bool which, function_pair& f,
|
Chris@16
|
778 boost::unordered::detail::true_type)
|
Chris@16
|
779 {
|
Chris@16
|
780 new((void*) &funcs_[which]) function_pair(f,
|
Chris@16
|
781 boost::unordered::detail::move_tag());
|
Chris@16
|
782 }
|
Chris@16
|
783
|
Chris@16
|
784 void destroy(bool which)
|
Chris@16
|
785 {
|
Chris@16
|
786 boost::unordered::detail::func::destroy((function_pair*)(&funcs_[which]));
|
Chris@16
|
787 }
|
Chris@16
|
788
|
Chris@16
|
789 public:
|
Chris@16
|
790
|
Chris@16
|
791 typedef boost::unordered::detail::set_hash_functions<H, P,
|
Chris@16
|
792 nothrow_move_assignable> set_hash_functions;
|
Chris@16
|
793
|
Chris@16
|
794 functions(H const& hf, P const& eq)
|
Chris@16
|
795 : current_(false)
|
Chris@16
|
796 {
|
Chris@16
|
797 construct(current_, hf, eq);
|
Chris@16
|
798 }
|
Chris@16
|
799
|
Chris@16
|
800 functions(functions const& bf)
|
Chris@16
|
801 : current_(false)
|
Chris@16
|
802 {
|
Chris@16
|
803 construct(current_, bf.current());
|
Chris@16
|
804 }
|
Chris@16
|
805
|
Chris@16
|
806 functions(functions& bf, boost::unordered::detail::move_tag)
|
Chris@16
|
807 : current_(false)
|
Chris@16
|
808 {
|
Chris@16
|
809 construct(current_, bf.current(),
|
Chris@16
|
810 boost::unordered::detail::integral_constant<bool,
|
Chris@16
|
811 nothrow_move_constructible>());
|
Chris@16
|
812 }
|
Chris@16
|
813
|
Chris@16
|
814 ~functions() {
|
Chris@16
|
815 this->destroy(current_);
|
Chris@16
|
816 }
|
Chris@16
|
817
|
Chris@16
|
818 H const& hash_function() const {
|
Chris@16
|
819 return current().first();
|
Chris@16
|
820 }
|
Chris@16
|
821
|
Chris@16
|
822 P const& key_eq() const {
|
Chris@16
|
823 return current().second();
|
Chris@16
|
824 }
|
Chris@16
|
825 };
|
Chris@16
|
826
|
Chris@16
|
827 template <class H, class P>
|
Chris@16
|
828 class set_hash_functions<H, P, false>
|
Chris@16
|
829 {
|
Chris@16
|
830 set_hash_functions(set_hash_functions const&);
|
Chris@16
|
831 set_hash_functions& operator=(set_hash_functions const&);
|
Chris@16
|
832
|
Chris@16
|
833 typedef functions<H, P> functions_type;
|
Chris@16
|
834
|
Chris@16
|
835 functions_type& functions_;
|
Chris@16
|
836 bool tmp_functions_;
|
Chris@16
|
837
|
Chris@16
|
838 public:
|
Chris@16
|
839
|
Chris@16
|
840 set_hash_functions(functions_type& f, H const& h, P const& p)
|
Chris@16
|
841 : functions_(f),
|
Chris@16
|
842 tmp_functions_(!f.current_)
|
Chris@16
|
843 {
|
Chris@16
|
844 f.construct(tmp_functions_, h, p);
|
Chris@16
|
845 }
|
Chris@16
|
846
|
Chris@16
|
847 set_hash_functions(functions_type& f, functions_type const& other)
|
Chris@16
|
848 : functions_(f),
|
Chris@16
|
849 tmp_functions_(!f.current_)
|
Chris@16
|
850 {
|
Chris@16
|
851 f.construct(tmp_functions_, other.current());
|
Chris@16
|
852 }
|
Chris@16
|
853
|
Chris@16
|
854 ~set_hash_functions()
|
Chris@16
|
855 {
|
Chris@16
|
856 functions_.destroy(tmp_functions_);
|
Chris@16
|
857 }
|
Chris@16
|
858
|
Chris@16
|
859 void commit()
|
Chris@16
|
860 {
|
Chris@16
|
861 functions_.current_ = tmp_functions_;
|
Chris@16
|
862 tmp_functions_ = !tmp_functions_;
|
Chris@16
|
863 }
|
Chris@16
|
864 };
|
Chris@16
|
865
|
Chris@16
|
866 template <class H, class P>
|
Chris@16
|
867 class set_hash_functions<H, P, true>
|
Chris@16
|
868 {
|
Chris@16
|
869 set_hash_functions(set_hash_functions const&);
|
Chris@16
|
870 set_hash_functions& operator=(set_hash_functions const&);
|
Chris@16
|
871
|
Chris@16
|
872 typedef functions<H, P> functions_type;
|
Chris@16
|
873
|
Chris@16
|
874 functions_type& functions_;
|
Chris@16
|
875 H hash_;
|
Chris@16
|
876 P pred_;
|
Chris@16
|
877
|
Chris@16
|
878 public:
|
Chris@16
|
879
|
Chris@16
|
880 set_hash_functions(functions_type& f, H const& h, P const& p) :
|
Chris@16
|
881 functions_(f),
|
Chris@16
|
882 hash_(h),
|
Chris@16
|
883 pred_(p) {}
|
Chris@16
|
884
|
Chris@16
|
885 set_hash_functions(functions_type& f, functions_type const& other) :
|
Chris@16
|
886 functions_(f),
|
Chris@16
|
887 hash_(other.hash_function()),
|
Chris@16
|
888 pred_(other.key_eq()) {}
|
Chris@16
|
889
|
Chris@16
|
890 void commit()
|
Chris@16
|
891 {
|
Chris@16
|
892 functions_.current().first() = boost::move(hash_);
|
Chris@16
|
893 functions_.current().second() = boost::move(pred_);
|
Chris@16
|
894 }
|
Chris@16
|
895 };
|
Chris@16
|
896
|
Chris@16
|
897 ////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
898 // rvalue parameters when type can't be a BOOST_RV_REF(T) parameter
|
Chris@16
|
899 // e.g. for int
|
Chris@16
|
900
|
Chris@16
|
901 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
Chris@16
|
902 # define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
|
Chris@16
|
903 #else
|
Chris@16
|
904 struct please_ignore_this_overload {
|
Chris@16
|
905 typedef please_ignore_this_overload type;
|
Chris@16
|
906 };
|
Chris@16
|
907
|
Chris@16
|
908 template <typename T>
|
Chris@16
|
909 struct rv_ref_impl {
|
Chris@16
|
910 typedef BOOST_RV_REF(T) type;
|
Chris@16
|
911 };
|
Chris@16
|
912
|
Chris@16
|
913 template <typename T>
|
Chris@16
|
914 struct rv_ref :
|
Chris@16
|
915 boost::detail::if_true<
|
Chris@16
|
916 boost::is_class<T>::value
|
Chris@16
|
917 >::BOOST_NESTED_TEMPLATE then <
|
Chris@16
|
918 boost::unordered::detail::rv_ref_impl<T>,
|
Chris@16
|
919 please_ignore_this_overload
|
Chris@16
|
920 >::type
|
Chris@16
|
921 {};
|
Chris@16
|
922
|
Chris@16
|
923 # define BOOST_UNORDERED_RV_REF(T) \
|
Chris@16
|
924 typename boost::unordered::detail::rv_ref<T>::type
|
Chris@16
|
925 #endif
|
Chris@16
|
926 }}}
|
Chris@16
|
927
|
Chris@16
|
928 #endif
|