cvector · Section 3
cvector_reset
NAME
cvector_reset - clear all elements and reset capacity
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cvector.h> void cvector_reset(cvec v);
DESCRIPTION
Removes every element from the vector and then tries to shrink the capacity back to the minimum of 4 elements. If that reallocation fails the capacity stays as it was, but the element count becomes 0 anyway.
PARAMETERS
v Vector to reset
NOTES
The element count becomes 0, and the capacity goes back to the minimum (4) when the reallocation succeeds. The elements are not freed one by one; the caller has to do that first when it is needed. Asserts if v is NULL.