cvector · Section 3
cvector_destroy
NAME
cvector_destroy - destroy a vector and set pointer to NULL
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cvector.h> cvector_destroy(v)
DESCRIPTION
Frees everything the vector owns, its data buffer included, and then sets the vector pointer to NULL.
PARAMETERS
v Vector to destroy. It must be a modifiable lvalue such as a
variable or an array element; the macro evaluates it exactly once
and sets it to NULL
NOTES
Calling it with a NULL pointer is safe and does nothing. The elements are not freed one by one, so when they point to heap buffers the caller has to free those first.