MCPcopy Create free account
hub / github.com/cosdata/cosdata / clear_data

Method clear_data

src/models/lazy_item.rs:95–102  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

93 }
94
95 pub fn clear_data(&self) {
96 let old_data = self.data.swap(ptr::null_mut(), Ordering::SeqCst);
97 if !old_data.is_null() {
98 unsafe {
99 drop(Box::from_raw(old_data));
100 }
101 }
102 }
103
104 pub fn is_ready(&self) -> bool {
105 !self.data.load(Ordering::Acquire).is_null()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected