Next: , Previous: Chain structure, Up: Chains


13.2 Allocating and freeing chains

— Function: Chain * chain_create (void)

Uses ‘mem_alloc’ to allocate a ‘Chain’ and initialises it to be an empty chain. Returns a reference to the allocated chain, or a null pointer if there was insufficient memory.

— Function: void chain_destroy (Chain *chain)

Finalises the internal data structures of chain, and then frees chain itself. chain must have been allocated by ‘chain_create’.