Zycore 1.5.2
Zyan Core Library for C
Loading...
Searching...
No Matches
ZyanList_ Struct Reference

Defines the ZyanList struct. More...

#include <List.h>

Collaboration diagram for ZyanList_:
[legend]

Data Fields

ZyanAllocatorallocator
 The memory allocator.
ZyanUSize size
 The current number of elements in the list.
ZyanUSize element_size
 The size of a single element in bytes.
ZyanMemberProcedure destructor
 The element destructor callback.
ZyanListNodehead
 The head node.
ZyanListNodetail
 The tail node.
void * buffer
 The data buffer.
ZyanUSize capacity
 The data buffer capacity (number of bytes).
ZyanListNodefirst_unused
 The first unused node.

Detailed Description

Defines the ZyanList struct.

All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior.

Field Documentation

◆ allocator

ZyanAllocator* allocator

The memory allocator.

◆ buffer

void* buffer

The data buffer.

Only used for instances created by ZyanListInitCustomBuffer.

◆ capacity

ZyanUSize capacity

The data buffer capacity (number of bytes).

Only used for instances created by ZyanListInitCustomBuffer.

◆ destructor

ZyanMemberProcedure destructor

The element destructor callback.

◆ element_size

ZyanUSize element_size

The size of a single element in bytes.

◆ first_unused

ZyanListNode* first_unused

The first unused node.

When removing a node, the first-unused value is updated to point at the removed node and the next node of the removed node will be updated to point at the old first-unused node.

When appending the memory of the first unused-node is recycled to store the new node. The value of the first-unused node is then updated to point at the reused nodes next node.

If the first-unused value is ZYAN_NULL, any new node will be "allocated" behind the tail node (if there is enough space left in the fixed size buffer).

Only used for instances created by ZyanListInitCustomBuffer.

◆ head

ZyanListNode* head

The head node.

◆ size

ZyanUSize size

The current number of elements in the list.

◆ tail

ZyanListNode* tail

The tail node.


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