Skip to main content

hash_map/
hash_map.rs

1use zigzag_alloc::alloc::system::SystemAllocator;
2use zigzag_alloc::collections::{ExHashMap, U64HashCtx};
3
4fn main() {
5    let alloc = SystemAllocator;
6    let ctx = U64HashCtx;
7    
8    let mut map = ExHashMap::new(&alloc, ctx);
9
10    map.insert(42, 100);
11    map.insert(1337, 9000);
12
13    if let Some(val) = map.get(&42) {
14        println!("Found: {}", val);
15    }
16
17    map.remove(&1337);
18
19    println!("Map len: {}, capacity: {}", map.len(), map.capacity());
20}