MCPcopy Create free account
hub / github.com/digama0/lean-sys / lean_array_pop

Function lean_array_pop

src/array/high_level.rs:134–145  ·  view source on GitHub ↗
(a: lean_obj_arg)

Source from the content-addressed store, hash-verified

132
133#[inline]
134pub unsafe fn lean_array_pop(a: lean_obj_arg) -> *mut lean_object {
135 let r = lean_ensure_exclusive_array(a);
136 let sz = lean_array_size(a);
137 if sz == 0 {
138 return r;
139 }
140 let sz = sz - 1;
141 let last = lean_array_cptr(r).add(sz);
142 *(raw_field!(lean_to_array(r), lean_array_object, m_size) as *mut usize) = sz;
143 lean_dec(*last);
144 r
145}
146
147#[inline]
148pub unsafe fn lean_array_uswap(a: lean_obj_arg, i: usize, j: usize) -> *mut lean_object {

Callers

nothing calls this directly

Calls 4

lean_array_sizeFunction · 0.85
lean_array_cptrFunction · 0.85
lean_decFunction · 0.85

Tested by

no test coverage detected