Vector 0.0.2
Loading...
Searching...
No Matches
vector_t Struct Reference

Vector control structure type. More...

Data Fields

size_t element_size
 Size of the underling element type.
 
size_t capacity
 Current amount of allocated elements.
 
size_t ext_header_size
 Size of the extention header.
 
size_t allocator_size
 Size of the allocator.
 
char memory []
 Beginning of the vector's memory region.
 

Detailed Description

Vector control structure type.

Designed to be passed by reference. Functions that can cause reallocation of the vector must take a double pointer to a vector, this way vector pointer will be updated.

Examples
aligned_alloc.c, create.c, and polymorph.c.

Definition at line 23 of file vector.c.

Field Documentation

◆ element_size

size_t vector_t::element_size

Size of the underling element type.

Definition at line 25 of file vector.c.

◆ capacity

size_t vector_t::capacity

Current amount of allocated elements.

Definition at line 26 of file vector.c.

◆ ext_header_size

size_t vector_t::ext_header_size

Size of the extention header.

Definition at line 27 of file vector.c.

◆ allocator_size

size_t vector_t::allocator_size

Size of the allocator.

Definition at line 28 of file vector.c.

◆ memory

char vector_t::memory[]

Beginning of the vector's memory region.

Must be offsetted by vector_t::ext_header_size and allocator size(if present) to get to the elements.

Definition at line 29 of file vector.c.