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

Method push

src/models/atomic_array.rs:47–55  ·  view source on GitHub ↗
(&self, item: *mut T)

Source from the content-addressed store, hash-verified

45 }
46
47 pub fn push(&self, item: *mut T) {
48 for i in 0..N {
49 if self.items[i].load(Ordering::SeqCst).is_null() {
50 self.items[i].store(item, Ordering::SeqCst);
51 return;
52 }
53 }
54 debug_assert!(false, "Array is full");
55 }
56
57 pub fn len(&self) -> usize {
58 for i in 0..N {

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected