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

Function lean_alloc_ctor

src/constructor.rs:23–40  ·  view source on GitHub ↗
(
    tag: c_uint,
    num_objs: c_uint,
    scalar_sz: c_uint,
)

Source from the content-addressed store, hash-verified

21
22#[inline]
23pub unsafe fn lean_alloc_ctor(
24 tag: c_uint,
25 num_objs: c_uint,
26 scalar_sz: c_uint,
27) -> *mut lean_object {
28 debug_assert!(
29 tag <= LeanMaxCtorTag as c_uint
30 && num_objs < LEAN_MAX_CTOR_FIELDS
31 && scalar_sz < LEAN_MAX_CTOR_SCALARS_SIZE
32 );
33 let o = lean_alloc_ctor_memory(
34 core::mem::size_of::<lean_ctor_object>() as c_uint
35 + (core::mem::size_of::<*const ()>() as c_uint) * num_objs
36 + scalar_sz,
37 );
38 lean_set_st_header(o, tag, num_objs);
39 o
40}
41
42#[inline(always)]
43pub unsafe fn lean_ctor_get(o: b_lean_obj_arg, i: c_uint) -> b_lean_obj_res {

Callers 7

lean_io_result_mk_okFunction · 0.85
lean_io_result_mk_errorFunction · 0.85
lean_box_uint32Function · 0.85
lean_box_uint64Function · 0.85
lean_box_usizeFunction · 0.85
lean_box_floatFunction · 0.85
lean_box_float32Function · 0.85

Calls 2

lean_alloc_ctor_memoryFunction · 0.85
lean_set_st_headerFunction · 0.85

Tested by

no test coverage detected