Function polars_arrow::ffi::mmap::slice_and_owner

source ·
pub unsafe fn slice_and_owner<T: NativeType, O>(
    slice: &[T],
    owner: O,
) -> PrimitiveArray<T>
Expand description

Creates a (non-null) PrimitiveArray from a slice of values. This does not have memcopy and is the fastest way to create a PrimitiveArray.

This can be useful if you want to apply arrow kernels on slices without incurring a memcopy cost.

§Safety

The caller must ensure the passed owner ensures the data remains alive.