Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
seq_t Struct Reference

#include <seq.h>

Collaboration diagram for seq_t:
[legend]

Data Fields

 ERROR_HEADER
size_t len
 logical length.
uint16_t tail_len
 0..SEQ_BR
uint8_t depth
 tree depth in levels (0 == leaf level)
seq_node_troot
 NULL means “all data is in tail”
seq_elem_ttail
 small tail array for fast push/pop.
const srn_context_tseq_ctx
 The context that owns every allocation the seq retains.

Detailed Description

Definition at line 155 of file seq.h.

Field Documentation

◆ depth

uint8_t seq_t::depth

tree depth in levels (0 == leaf level)

Definition at line 165 of file seq.h.

◆ ERROR_HEADER

seq_t::ERROR_HEADER

Definition at line 156 of file seq.h.

◆ len

size_t seq_t::len

logical length.

While techically this implementation will support up to 2^85 elements in each seq, but we will limit it down to (2^64-1)(UINT64_MAX)(on 64bit machines) in order to keep the seq_t as small as possible

Definition at line 161 of file seq.h.

◆ root

seq_node_t* seq_t::root

NULL means “all data is in tail”

Definition at line 167 of file seq.h.

◆ seq_ctx

const srn_context_t* seq_t::seq_ctx

The context that owns every allocation the seq retains.

seq_empty sets it and every version returned by seq_push inherits it. Pushes allocate tail copies, leaves, and cloned nodes in this context's block chain, never in the pushing caller's, so every version stays valid for as long as this context lives. Elements are stored as is; the caller must allocate them with a lifetime at least as long as this context.

Definition at line 177 of file seq.h.

◆ tail

seq_elem_t* seq_t::tail

small tail array for fast push/pop.

We allocate this in heap with SEQ_BR size and move it later to the inner Nodes.

Definition at line 170 of file seq.h.

◆ tail_len

uint16_t seq_t::tail_len

0..SEQ_BR

Definition at line 163 of file seq.h.


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