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

Function alloc_and_read

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

Source from the content-addressed store, hash-verified

216
217 #[test]
218 fn alloc_and_read() {
219 let mut pool = SlabPool::new(0, 1024, 4);
220 let data = b"hello slab allocator";
221 let id = pool.alloc(data).unwrap();
222 assert_eq!(id.core_id, 0);
223 assert_eq!(id.len, data.len() as u32);
224 assert_eq!(pool.read(id), data);
225 }
226
227 #[test]
228 fn alloc_exhaustion() {

Callers

nothing calls this directly

Calls 1

allocMethod · 0.45

Tested by

no test coverage detected