forked from boostorg/intrusive
Some fixes for inspection report, Run Date: 15:00:47 UTC, Friday 27 June 2008
[SVN r46787]
This commit is contained in:
@@ -1,9 +1,14 @@
|
|||||||
|
<!--
|
||||||
|
Copyright 2005-2008 Ion Gaztanaga
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="refresh" content="0; URL=../../doc/html/intrusive.html">
|
<meta http-equiv="refresh" content="0; URL=../../doc/html/intrusive.html">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
Automatic redirection failed, please go to
|
Automatic redirection failed, please go to
|
||||||
<a href="../../doc/html/intrusive">../../doc/html/intrusive</a>
|
<a href="../../doc/html/intrusive.html">../../doc/html/intrusive.html</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
Implement incremental hashing:
|
|
||||||
|
|
||||||
bucket_len is power of two
|
|
||||||
cur_idx is always at least, half of bucket_len
|
|
||||||
|
|
||||||
find bucket from value:
|
|
||||||
size_type bucket_num = hash(val) &(bucket_len - 1);
|
|
||||||
if (bucket_num >= cur_idx)
|
|
||||||
bucket_num -= bucket_len/2;
|
|
||||||
|
|
||||||
incremental_rehash:
|
|
||||||
|
|
||||||
iterator _Plist, _Where;
|
|
||||||
if (load_factor > LoadFactorLimit)
|
|
||||||
{ // too dense, need to grow hash table
|
|
||||||
if (cur_idx >= (bucket_len - 1))
|
|
||||||
{ // table full, request doubling
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (cur_idx >= bucket_len)
|
|
||||||
bucket_len*=2;
|
|
||||||
|
|
||||||
size_type bucket_num = cur_idx - bucket_len/2;
|
|
||||||
// rehash elements from bucket_num
|
|
||||||
++cur_idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
insert from value:
|
|
||||||
|
|
||||||
size_type bucket_num = hash(val) & (bucket_len - 1);
|
|
||||||
if (bucket_num >= cur_idx)
|
|
||||||
bucket_num -= bucket_len/2;
|
|
||||||
insert in bucket
|
|
||||||
|
|
||||||
rehash:
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user