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

A dynamic buffer for staged machine code generation. More...

#include <infix_internals.h>

Collaboration diagram for code_buffer:
[legend]

Public Attributes

uint8_tcode
 
size_t capacity
 
size_t size
 
bool error
 
infix_arena_tarena
 

Detailed Description

A dynamic buffer for staged machine code generation.

This structure is used during the JIT compilation process. ABI-specific emitters append instruction bytes to this buffer. It automatically grows as needed, allocating memory from a temporary arena that is destroyed after the final code is copied to executable memory.

Member Data Documentation

◆ arena

infix_arena_t* code_buffer::arena

The temporary arena used for code generation.

◆ capacity

size_t code_buffer::capacity

The current capacity of the buffer.

◆ code

uint8_t* code_buffer::code

A pointer to the code buffer, allocated from the arena.

◆ error

bool code_buffer::error

A flag set on allocation failure.

◆ size

size_t code_buffer::size

The number of bytes currently written to the buffer.


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