ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
buffer_node Struct Reference

Node header embedded before user data. More...

#include <include/ascii-chat/buffer_pool.h>

Data Fields

uint32_t magic
 Magic to identify pooled buffers.
 
uint32_t _pad
 Padding for alignment.
 
size_t size
 Size of user data portion.
 
atomic_ptr_t next
 Next in free list (lock-free)
 
atomic_t returned_at_ns
 Timestamp when returned to free list (nanoseconds)
 
struct buffer_pool * pool
 Owning pool (for free)
 

Detailed Description

Node header embedded before user data.

Layout in memory: [buffer_node_t header][user data...] ^– pointer returned to caller

Definition at line 71 of file buffer_pool.h.

Field Documentation

◆ _pad

uint32_t buffer_node::_pad

Padding for alignment.

Definition at line 73 of file buffer_pool.h.

Referenced by buffer_pool_alloc().

◆ magic

uint32_t buffer_node::magic

Magic to identify pooled buffers.

Definition at line 72 of file buffer_pool.h.

Referenced by buffer_pool_alloc(), and buffer_pool_free().

◆ next

atomic_ptr_t buffer_node::next

Next in free list (lock-free)

Definition at line 75 of file buffer_pool.h.

Referenced by buffer_pool_alloc(), buffer_pool_destroy(), buffer_pool_free(), and buffer_pool_shrink().

◆ pool

struct buffer_pool* buffer_node::pool

Owning pool (for free)

Definition at line 77 of file buffer_pool.h.

Referenced by buffer_pool_alloc(), and buffer_pool_free().

◆ returned_at_ns

atomic_t buffer_node::returned_at_ns

Timestamp when returned to free list (nanoseconds)

Definition at line 76 of file buffer_pool.h.

Referenced by buffer_pool_alloc(), buffer_pool_free(), and buffer_pool_shrink().

◆ size

size_t buffer_node::size

Size of user data portion.

Definition at line 74 of file buffer_pool.h.

Referenced by buffer_pool_alloc(), buffer_pool_free(), and buffer_pool_shrink().


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