A variable-sized array
If length is greater than zero, `double *values = malloc(length * sizeof *values);` requests space for length doubles. Check `values` before using it: a failed allocation returns a null pointer. Initialize the elements you need, then call `free(values)` when the array is no longer needed. section 13.1
`malloc`, declared in `<stdlib.h>`, allocates storage on demand and returns a pointer to it. Unlike `calloc`, it does not clear the new storage. Request a size strictly greater than zero. This makes `malloc` useful when an array’s size depends on data known only while the program runs. section 13.1
TAKEAWAY: Treat allocation and release as one lifecycle.
- Check for a null pointer before copying into or otherwise using newly allocated storage. section 13.1
- Match every successful allocation with a `free`. Missing releases can leak memory and exhaust resources. section 13.1.2
- Pass `free` an allocated pointer as returned, not a pointer into its storage, an ordinary variable’s address, or a pointer already freed. section 13.1.2
A resizable circular buffer shows why this lifecycle matters: initialization allocates its data array, destruction releases it, and resizing may replace the array through `realloc`. A returned replacement pointer must not be ignored. section 13.1.1

