Skip to main content

nova_rt_str_concat_n

Function nova_rt_str_concat_n 

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

Concatenate every string in parts into one new string: the n-ary form string interpolation of three or more parts lowers to.

One copy of each part into one result, where pairwise concatenation made a new string per part, each copying everything built so far. Each part is copied straight into the result’s bytes.

GC safety: the parts are read after the result’s buffer is allocated. parts, held in this frame, keeps the array and so every part alive across that allocation, as [gc_str_filled] describes.

§Safety

parts must point to a Nova array { len: i64, elems… } whose element i, at byte offset 8 + 8*i, is a valid NovaStr pointer. A negative length is treated as zero, as nova_rt_str_from_chars does.