nu_dup

Creates a shallow duplicate of the given buffer.

@nogc @trusted
inout(T)[]
nu_dup
(
T
)
(
inout(T)[] buffer
)

Parameters

buffer inout(T)[]

Buffer to duplicate.

Memorysafety: This function copies data out of the string 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: inout(T)[]

Duplicated slice, must be freed with nu_resize

Meta