resize

Resize an array whose buffer was allocated by malloc().

It's safe to pass an array whose current length is 0, the array would be allocated.

It's also safe to specify the new_length of an array to be 0, the array would be deallocated.

void
resize
(
Item
)
(
ref Item[] arr_to_resize
,
size_t new_length
)

Parameters

Item

the type of items making up the array

arr_to_resize Item[]

the array that should be resized

new_length size_t

the new length that the item should be resize to

Meta