pub struct TreeInfo(/* private fields */);Expand description
Compact heap-allocated metadata for BTreeMap.
Holds leaf_count, inter_count, and a growable path-cache stack in one
contiguous allocation, decoupled from the BTreeMap struct itself.
§Heap memory layout
[TreeInfoHeader | (InterNode<K,V>, u32) × cap]
Initial buffer = one CACHE_LINE_SIZE block; grows by one block per overflow.
§Stack memory layout
TreeInfo store either point, or ((entry_idx) << 8) | EMPTY_FLAG.
Because in our scenario iteration with Entry is hot path, to reduce moving cost, we pack
entry_idx inside TreeInfo stack or Heap (TreeInfoHeader)
NOTE: we tried enum u8 and NonNull, but rustc does not pack it to usize.
Using NonZeroUsize will optimize Option<BTreeMap>
Trait Implementations§
impl Send for TreeInfo
impl Stats for TreeInfo
impl Sync for TreeInfo
Auto Trait Implementations§
impl Freeze for TreeInfo
impl RefUnwindSafe for TreeInfo
impl Unpin for TreeInfo
impl UnsafeUnpin for TreeInfo
impl UnwindSafe for TreeInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more