Skip to content

Commit 9cacc35

Browse files
committed
Unify leaf nodes with internal nodes and container nodes
Previously the leaf nodes where a separate type, and internal nodes and container nodes were represented by the same type. This changes the representation such that all nodes are represented by sharing_nodet. This will allow an internal node to directly point to a leaf node (instead of having to point to a container node which in turn points to a leaf node).
1 parent be1cbf2 commit 9cacc35

File tree

3 files changed

+139
-159
lines changed

3 files changed

+139
-159
lines changed

src/util/sharing_map.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,8 @@ class sharing_mapt
193193
typedef std::vector<key_type> keyst;
194194

195195
protected:
196-
typedef sharing_node_innert<key_type, mapped_type> innert;
197-
typedef sharing_node_leaft<key_type, mapped_type> leaft;
198-
199-
typedef sharing_node_baset baset;
196+
typedef sharing_nodet<key_type, mapped_type> innert;
197+
typedef sharing_nodet<key_type, mapped_type> leaft;
200198

201199
typedef typename innert::to_mapt to_mapt;
202200
typedef typename innert::leaf_listt leaf_listt;
@@ -721,7 +719,7 @@ ::count_unmarked_nodes(
721719
for(const auto &l : ll)
722720
{
723721
const unsigned leaf_use_count = l.use_count();
724-
const void *leaf_raw_ptr = &l.read();
722+
const void *leaf_raw_ptr = &l.read_leaf();
725723

726724
if(leaf_use_count >= 2)
727725
{

0 commit comments

Comments
 (0)