[go: up one dir, main page]

dashmap 1.0.5

Extremely fast concurrent map.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::{mem, ptr};

#[inline]
pub const fn ptr_size_bits() -> usize {
    mem::size_of::<usize>() * 8
}

/// Must not panic
#[inline]
pub unsafe fn map_in_place<T>(r: &mut T, f: impl FnOnce(T) -> T) {
    ptr::write(r, f(ptr::read(r)));
}