YAVL 0.1.0
Yet Another Vector Library – still better than C++ impl. :P
Loading...
Searching...
No Matches
yavl_vec_t Struct Reference

Type-agnostic vector definition. More...

#include <vec.h>

Public Attributes

void * data
 Pointer to data array.
size_t allign
 Current data allignment (size of individual vector element in unsigned chars).
size_t len
 Current data length.
size_t reservd
 Currently reserved data.

Detailed Description

Type-agnostic vector definition.

It stores data on heap, although the metadata can be stored wherever, with stack being recommended when vector is being used as an intermediate type for array generation. The metadata has to be detached from data, as memory usage for data is assumed to be very volatile and it is preffered to drop metadata when converting to the regular C arrays.

Note
Read-write and manual structure definition is currently discouraged and may cause undefined behaviour. With that being said, metadata needs to be allocated in read-write memory space. In the future, access to struct might be greatly limited to limit unsafe access to vector.

Member Data Documentation

◆ data

void* yavl_vec_t::data

Pointer to data array.

Raw access is considered unsafe and requires additional memory checks done automatically by the library.

◆ len

size_t yavl_vec_t::len

Current data length.

Should be used for array bounds.

◆ reservd

size_t yavl_vec_t::reservd

Currently reserved data.

Should be used for memory calculations.


The documentation for this struct was generated from the following file: