MCPcopy Create free account
hub / github.com/argumentcomputer/ix / rs_refcount_cache_dedup

Function rs_refcount_cache_dedup

crates/ffi/src/refcount.rs:196–208  ·  view source on GitHub ↗
(
  name: LeanIxName<LeanBorrowed<'_>>,
  n: usize,
)

Source from the content-addressed store, hash-verified

194/// Each element's lean_dec on drop must work correctly.
195#[unsafe(no_mangle)]
196pub extern "C" fn rs_refcount_cache_dedup(
197 name: LeanIxName<LeanBorrowed<'_>>,
198 n: usize,
199) -> LeanArray<LeanOwned> {
200 let decoded = name.decode();
201 let mut cache = LeanBuildCache::new();
202 let arr = LeanArray::alloc(n);
203 for i in 0..n {
204 let lean_name = LeanIxName::build(&mut cache, &decoded);
205 arr.set(i, lean_name);
206 }
207 arr
208}
209
210// =============================================================================
211// Persistent object handling

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected