nu_idup

Creates a shallow immutable duplicate of the given buffer.

@nogc @trusted
immutable(T)[]
nu_idup
(
T
)
(
inout(T)[] buffer
)

Parameters

buffer inout(T)[]

Buffer to duplicate.

Memorysafety: This function copies data out of the slice into a new memory allocation; as such it has to be freed. It is otherwise safe, in that it won't modify the original memory provided.

Return Value

Type: immutable(T)[]

Duplicated slice, must be freed with nu_resize

Meta