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

Function rs_refcount_array_element_borrow

crates/ffi/src/refcount.rs:274–286  ·  view source on GitHub ↗
(
  arr: LeanArray<LeanBorrowed<'_>>,
)

Source from the content-addressed store, hash-verified

272/// Tests that borrowed array elements survive while array is alive.
273#[unsafe(no_mangle)]
274pub extern "C" fn rs_refcount_array_element_borrow(
275 arr: LeanArray<LeanBorrowed<'_>>,
276) -> LeanArray<LeanOwned> {
277 let len = arr.len();
278 let out = LeanArray::alloc(len);
279 for i in 0..len {
280 let borrowed_elem = arr.get(i);
281 let level = LeanIxLevel(borrowed_elem).decode();
282 let mut cache = LeanBuildCache::new();
283 out.set(i, LeanIxLevel::build(&mut cache, &level));
284 }
285 out
286}
287
288// =============================================================================
289// Multi-threaded tests using LeanShared on ix domain types

Callers

nothing calls this directly

Calls 3

lenMethod · 0.45
getMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected