cdcontainers
0.1.1
Library of data containers and collections for C programming language.
|
Functions | |
enum cdc_stat | cdc_array_reserve (struct cdc_array *v, size_t capacity) |
Attempts to allocate memory for at least size elements. If you know in advance how large the array will be, you should call this function to prevent reallocations and memory fragmentation. More... | |
static bool | cdc_array_empty (struct cdc_array *v) |
Checks if the array has no elements. More... | |
static size_t | cdc_array_size (struct cdc_array *v) |
Returns the number of elements in the array. More... | |
static size_t | cdc_array_capacity (struct cdc_array *v) |
Returns the number of elements that the container has currently allocated space for. More... | |
enum cdc_stat | cdc_array_shrink_to_fit (struct cdc_array *v) |
Requests the container to reduce its capacity to fit its size. More... | |
Attempts to allocate memory for at least size elements. If you know in advance how large the array will be, you should call this function to prevent reallocations and memory fragmentation.
[in] | v | - cdc_array |
[in] | capacity | - new capacity |
|
inlinestatic |
Checks if the array has no elements.
[in] | v | - cdc_array |
|
inlinestatic |
Returns the number of elements in the array.
[in] | v | - cdc_array |
|
inlinestatic |
Returns the number of elements that the container has currently allocated space for.
[in] | v | - cdc_array |