vt_term 7 2016-03-05 genvector manual

NAME

vt_term - optional user defined terminator element

SYNPOSIS

#define GVT_TERM '\0'

DESCRIPTION

When macro GVT_TERM is defined during vt_instantiation(7), the resulting vector is terminated. Termination means genvector always inserts a terminator entry after the last real element of the array. For this, the allocated size (field: alloced) of the array is always kept at least one element larger than the real size (field: used), even when the array is empty (used==0). Most of the vt_ calls maintain the terminator record to make sure the vector is always properly terminated.

An exception is the low level call vt_resize(3), which manipulates the alloced field and the actual memory allocation but does not always update the used field and never adds a terminator. vt_uninit(3) also removes the terminator while free'ing the array.

The terminator record is not constructed (vt_construction(7)) or initialized (vt_init_elem(7)).

If the macro is not defined, the vector is non-terminated: no terminator element is added automatically.

SEE ALSO

vt_term 7 2016-03-05 genvector manual