microlisp 0.1.0
A small Scheme-subset interpreter in modern C.
Loading...
Searching...
No Matches
Data Fields
microlisp_options Struct Reference

Options controlling a state. More...

#include <microlisp.h>

Collaboration diagram for microlisp_options:
Collaboration graph
[legend]

Data Fields

const microlisp_allocatorallocator
 Allocator.
 
size_t max_read_depth
 Maximum reader nesting depth.
 
size_t max_eval_depth
 Maximum evaluator recursion depth.
 
size_t max_print_depth
 Maximum printer pair-walk depth.
 
size_t max_equal_depth
 Maximum structural-equality walk depth.
 
size_t gc_initial_threshold
 Hard ceiling on heap objects between GC collections.
 

Detailed Description

Options controlling a state.

Zero-initialize to use defaults; pass NULL to microlisp_state_create for "all defaults."

Field Documentation

◆ allocator

const microlisp_allocator* microlisp_options::allocator

Allocator.

NULL means stdlib malloc / free.

◆ gc_initial_threshold

size_t microlisp_options::gc_initial_threshold

Hard ceiling on heap objects between GC collections.

0 means "use the built-in default" (currently 4096 objects, doubling with the live set after each collection). This is a heuristic knob, not a contract: collection policy may change between minor releases.

◆ max_equal_depth

size_t microlisp_options::max_equal_depth

Maximum structural-equality walk depth.

0 means MICROLISP_DEFAULT_MAX_EQUAL_DEPTH. equal? and eqv? on trees deeper than this fail with MICROLISP_ERR_EQUAL_DEPTH instead of exhausting the host C stack. Same v0.2-iterative plan as the printer.

◆ max_eval_depth

size_t microlisp_options::max_eval_depth

Maximum evaluator recursion depth.

0 means MICROLISP_DEFAULT_MAX_EVAL_DEPTH. Tail-recursive code runs in constant C-stack space regardless of this limit; the cap only constrains non-tail-recursive invocations that grow the host C stack. Forms that exceed it fail with MICROLISP_ERR_EVAL_DEPTH.

◆ max_print_depth

size_t microlisp_options::max_print_depth

Maximum printer pair-walk depth.

0 means MICROLISP_DEFAULT_MAX_PRINT_DEPTH. Output of trees deeper than this fails with MICROLISP_ERR_PRINT_DEPTH instead of exhausting the host C stack. v0.1's printer is recursive on the pair-car axis; the limit bounds the worst case until v0.2's iterative printer lands.

◆ max_read_depth

size_t microlisp_options::max_read_depth

Maximum reader nesting depth.

0 means MICROLISP_DEFAULT_MAX_READ_DEPTH. Forms deeper than the limit fail with MICROLISP_ERR_READ_DEPTH.


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