Skip to content

Commit 3e485d7

Browse files
committed
BTreeMap: keep an eye out on the size of the main components
1 parent fd15e61 commit 3e485d7

File tree

1 file changed

+9
-0
lines changed
  • library/alloc/src/collections/btree/node

1 file changed

+9
-0
lines changed

library/alloc/src/collections/btree/node/tests.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ fn test_splitpoint() {
2323
assert!(left_len + right_len == CAPACITY);
2424
}
2525
}
26+
27+
#[test]
28+
#[cfg(target_arch = "x86_64")]
29+
fn test_sizes() {
30+
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
31+
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 8 * 2);
32+
assert_eq!(core::mem::size_of::<InternalNode<(), ()>>(), 112);
33+
assert_eq!(core::mem::size_of::<InternalNode<i64, i64>>(), 112 + CAPACITY * 8 * 2);
34+
}

0 commit comments

Comments
 (0)