MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / alloc_exhaustion

Function alloc_exhaustion

nodedb/src/bridge/slab.rs:228–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226
227 #[test]
228 fn alloc_exhaustion() {
229 let mut pool = SlabPool::new(0, 64, 2);
230 let _id1 = pool.alloc(b"first").unwrap();
231 let _id2 = pool.alloc(b"second").unwrap();
232 assert!(pool.alloc(b"third").is_none()); // Pool exhausted.
233 }
234
235 #[test]
236 fn free_and_reuse() {

Callers

nothing calls this directly

Calls 1

allocMethod · 0.45

Tested by

no test coverage detected