cp_heap_contract(3) - Linux man page

Name

cp_heap_contract - reduce allocated heap size to accomodate for the

current number of items

Synopsis

#include <cprops/heap.h>

int cp_heap_contract(cp_heap *heap);

Description

cp_heap represents a heap data structure internally using a pointer array which is resized when it becomes full. After removing items, the internal array remains at the maximal size required during operation. To adapt the internal array size for the current heap usage, call cp_heap_contract.

Return Value

cp_heap_contract returns 0 on success, non-zero if reallocation fails.

Referenced By

cp_heap_size(3)