mnemosyne-local 0.6.0

Thread-local allocation engine for Mnemosyne
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::state::NUM_CPU_SLOTS;
use super::types::PerCpuCacheHandle;

#[test]
fn cache_handle_allocates_storage_on_first_access() {
    let handle = PerCpuCacheHandle::new();
    assert_eq!(handle.storage.get().map(|cache| cache.slots.len()), None);

    let _cache = handle.get();

    assert_eq!(
        handle.storage.get().map(|cache| cache.slots.len()),
        Some(NUM_CPU_SLOTS)
    );
}