Skip to main content

nova_rt_bytes_to_ints

Function nova_rt_bytes_to_ints 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nova_rt_bytes_to_ints( b: *const NovaStr, ) -> *mut u8
Expand description

Decompose b into a Nova [Int], one element per byte in 0..=255.

The result must match exactly what codegen emits for an array: one block holding { len: i64, elem0, elem1, … }, element i at byte offset 8 + 8*i, allocated scanned — the same layout nova_rt_str_chars (nova-runtime’s crate root) builds for [Char], and pinned here the same way that one is pinned, in this module’s own mod tests (to_ints_writes_the_array_layout_codegen_expects, below).

§Safety

b must point to a live NovaStr.