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

Function clear_resets_without_dealloc

nodedb-wal/src/align.rs:240–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238
239 #[test]
240 fn clear_resets_without_dealloc() {
241 let mut buf = AlignedBuf::with_default_alignment(8192).unwrap();
242 let ptr_before = buf.as_ptr();
243 buf.write(b"some data");
244 buf.clear();
245 assert_eq!(buf.len(), 0);
246 assert!(buf.is_empty());
247 assert_eq!(buf.as_ptr(), ptr_before); // Same allocation.
248 }
249}

Callers

nothing calls this directly

Calls 3

as_ptrMethod · 0.45
writeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected