Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
s_vector Struct Reference

Dynamic array storing contiguous fixed-size items. More...

#include <libft.h>

Data Fields

voiddata
 Pointer to the contiguous array of items (borrowed or owned by the vector, may be NULL).
 
size_t cap
 Current capacity in items, also encoding storage ownership.
 
size_t len
 Current number of stored items, expressed in items.
 
size_t item_size
 Size of each item, expressed in bytes.
 

Detailed Description

Dynamic array storing contiguous fixed-size items.

Items are stored contiguously, with no gaps between them. When s_vector::data is not NULL and s_vector::cap is 0, the vector borrows its storage. When s_vector::cap is greater than 0, the vector owns its storage.

Field Documentation

◆ cap

size_t s_vector::cap

Current capacity in items, also encoding storage ownership.

◆ data

void* s_vector::data

Pointer to the contiguous array of items (borrowed or owned by the vector, may be NULL).

◆ item_size

size_t s_vector::item_size

Size of each item, expressed in bytes.

◆ len

size_t s_vector::len

Current number of stored items, expressed in items.


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