infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
infix_arena_t Struct Reference

Internal definition of a memory arena. More...

#include <infix_internals.h>

Collaboration diagram for infix_arena_t:
[legend]

Public Attributes

char * buffer
 
size_t capacity
 
size_t current_offset
 
bool error
 
struct infix_arena_tnext_block
 
size_t block_size
 

Detailed Description

Internal definition of a memory arena.

An arena is a fast, region-based allocator. It pre-allocates a single block of memory and serves subsequent small allocation requests by simply "bumping" a pointer. All memory allocated from an arena is freed at once by destroying the arena itself, eliminating the need to track individual allocations.

Member Data Documentation

◆ block_size

size_t infix_arena_t::block_size

The size of this specific block's buffer, for chained arenas.

◆ buffer

char* infix_arena_t::buffer

The backing memory buffer for the arena.

◆ capacity

size_t infix_arena_t::capacity

The total size of the buffer.

◆ current_offset

size_t infix_arena_t::current_offset

The current high-water mark of allocation.

◆ error

bool infix_arena_t::error

A flag set if any allocation fails, preventing subsequent allocations.

◆ next_block

struct infix_arena_t* infix_arena_t::next_block

A pointer to the next block in the chain, if this one is full.


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