praxis-runtime 0.2.0

GC ABI types, type descriptors, and runtime context for Praxis.
Documentation
//! Runtime heap, type descriptors, and runtime context for Praxis.
//!
//! This crate is the contract between JIT-generated code and the Rust runtime,
//! and it holds the GC implementation.
//!
//! - Every language value is a uniform [`GcRef`] (§4.3, §11.1).
//! - Every generated function follows `fn(RuntimeContext*, GcRef...) -> GcRef`
//!   (§10.3).
//! - Runtime wrappers never let a Rust panic unwind across the ABI (§9.2); they
//!   set `pending_fault` and return a defined sentinel instead.
//! - A [`TypeDescriptor`] centralizes every operation on a value's payload
//!   (§11.4), so the compiler never has to scatter type switches.
//! - A precise, non-moving mark-and-sweep collector reclaims unreachable
//!   objects (§12.1, ADR-011).
//!
//! See `docs/technical-design.md` §11, §12, and Appendix B.

pub mod abi;
pub mod bitset;
pub mod breakpoint;
pub mod closures;
pub mod collections;
pub mod context;
pub mod crash_snapshot;
pub mod debug;
pub mod descriptor;
pub mod dynamic_key;
pub mod enums;
pub mod gc;
pub mod graph;
pub mod heap;
pub mod heaps;
pub mod immortal;
pub mod input;
pub mod maps;
/// The order a hash-backed collection walks and prints its keys in (ADR-138).
/// Crate-private — it is `Map`/`Set`/`Counter`'s internal sort key, and nothing
/// outside the runtime picks one.
pub(crate) mod ordering;
/// Size-class pages: the storage and the liveness bitmaps behind [`Heap`]
/// (ADR-103). Crate-private — a page is the collector's business and nothing
/// outside it has a reason to name one.
pub(crate) mod page;
pub mod parse_detail;
pub mod parser;
pub mod range;
pub mod records;
pub mod repr;
pub mod repr_c_vec;
pub mod roots;
pub mod scalars;
pub mod shadow_stack;
pub mod small_char;
pub mod small_int;
pub mod teardown;
pub mod text;
pub mod tuples;
pub mod var_cell;

pub use abi::{RUNTIME_ABI_VERSION, assert_abi_version};
pub use breakpoint::{
    BreakpointHandler, BreakpointStop, Resume, breakpoints_detached, clear_breakpoint_handler,
    install_breakpoint_handler,
};
pub use closures::ClosurePayload;
pub use collections::{DequePayload, GridPayload, VecPayload};
pub use context::{
    DebugLocal, FRAME_BYTES_BASE, FRAME_BYTES_PER_SLOT, Fault, FaultKind, FaultMessage,
    MAX_RECURSION_DEPTH, REFERENCE_FRAME_SLOTS, Runtime, RuntimeContext, STACK_BUDGET_BYTES,
    StackBudget, current_fault_kind, frame_cost,
};
pub use crash_snapshot::{CrashSnapshot, SnapshotFrame, SnapshotSlot};
pub use debug::{
    DebugFrameEntry, DebugFrameStack, DebugFrameStackHeader, DebugLocalMeta, DebugSlotKind,
    DebugValue, DebugValueStack, DebugValueStackHeader, FunctionDebugMeta, LOCAL_KIND_TEMP,
    LOCAL_KIND_USER, ScalarValue,
};
pub use descriptor::{
    BUILTINS, BuiltinTypeId, CompareFn, DropFn, DynamicHasher, EqualsFn, FormatFn, FormatSink,
    FormatStyle, HashFn, StructHasher, TraceFn, Tracer, TypeDescriptor, TypeId,
};
pub use gc::{GcHeader, GcRef, HeapId};
pub use heap::{
    Heap, HeapStats, INITIAL_COLLECT_THRESHOLD, InlineClaimSite, InlineInternSite, LIVE_HEADROOM,
    MAX_COLLECT_THRESHOLD, Pacer,
};
pub use immortal::Immortals;
pub use input::{InputReader, clear_input_reader, install_input_reader};
pub use parse_detail::{ParseDetail, ParseFail};
pub use records::{RecordField, RecordPayload, RecordSchema, SchemaIdentity};
pub use repr::{InstanceArg, InstanceRepr, instance_repr};
pub use repr_c_vec::{ReprCVec, VecMut};
pub use roots::{
    NATIVE_ROOT_RESERVATION, NativeRootStore, NativeScope, RootScope, RootSet, Rooted, RuntimeRoots,
};
pub use shadow_stack::{
    DebugSlotCount, MAX_DEBUG_VALUE_SLOTS, MAX_SHADOW_SLOTS, SHADOW_STACK_SLOTS, ShadowFrameGuard,
    ShadowStack, ShadowStackHeader, SlotCount, SlotStack, SlotStackHeader, push_frame,
};
pub use small_int::{
    SMALL_INT_COUNT, SMALL_INT_MAX, SMALL_INT_MIN, SMALL_INT_STRIDE, index_of as small_int_index,
};
pub use teardown::{HeapDrained, retire_parser_plans};
pub use text::TextPayload;
pub use tuples::{TuplePayload, TupleSchema};