Skip to main content

len_to_ptr_unchecked

Function len_to_ptr_unchecked 

Source
pub(crate) const unsafe fn len_to_ptr_unchecked<T: Sized>(
    len: usize,
) -> NonNull<T>
Expand description

ยงSafety

len must be != 0, this uses the NonNull to store a length, so the length must be stored offset by one. This function expect the len to be already shifted