chashmap · Section 3
chmap_destroy
NAME
chmap_destroy - destroy a hash map and set pointer to NULL
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/chashmap.h> chmap_destroy(hm);
DESCRIPTION
Frees everything the hash map holds, all key-value pairs included, and then sets the hash map pointer to NULL. This is the name the type-inferred macro layer uses for chashmap_destroy(3). It behaves the same way.
PARAMETERS
hm Hash map to destroy (set to NULL after destruction)
NOTES
Safe to call with a NULL pointer Frees all keys and values Frees every bucket collision chain and the bucket/slot array itself The macro evaluates hm exactly once. It must be a modifiable lvalue, such as a variable or an array element, and an expression with a side effect such as handles[i++] destroys and clears exactly one element.
SEE ALSO
chashmap_destroy(3), chashmap_create(3), chashmap_destroy_with_dtor(3)