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

Function lean_alloc_array

src/array/low_level.rs:5–13  ·  view source on GitHub ↗
(size: usize, capacity: usize)

Source from the content-addressed store, hash-verified

3
4#[inline]
5pub unsafe fn lean_alloc_array(size: usize, capacity: usize) -> *mut lean_object {
6 let o = lean_alloc_object(
7 core::mem::size_of::<lean_array_object>() + core::mem::size_of::<*mut ()>() * capacity,
8 );
9 lean_set_st_header(o as *mut _, LeanArray as u32, 0);
10 (raw_field!(o, lean_array_object, m_size) as *mut usize).write(size);
11 (raw_field!(o, lean_array_object, m_capacity) as *mut usize).write(capacity);
12 o as *mut _
13}
14
15#[inline(always)]
16pub unsafe fn lean_array_size(o: b_lean_obj_arg) -> usize {

Callers 2

lean_mk_empty_arrayFunction · 0.85

Calls 1

lean_set_st_headerFunction · 0.85

Tested by

no test coverage detected