cljrs-env
Environments for running programs in.
gc_roots module
The gc_roots module manages GC root registration for the interpreter's Rust call stack. Public API includes:
push_env_root(env: &Env) -> EnvRootGuard— registers anEnvpointer as a GC root; guard removes on droproot_value(val: &Value) -> ValueRootGuard— registers a singleValuepointer as a GC rootroot_values(vals: &[Value]) -> ValueRootGuard— registers a slice ofValuepointers as GC rootsroot_option_values(vals: &[Option<Value>]) -> OptionValueRootGuard— registers anOption<Value>slice (e.g. IR register file)gc_safepoint(env: &Env)— interpreter-level safepoint: parks if collection in progress, or initiates collection on memory pressureforce_collect(env: &Env)— immediately initiates a GC collection bypassing memory-pressure thresholdasync_gc_collect()— services a pending GC request from a TokioLocalSettask at a cooperative yield point; safe to call when no other tasks are polling, so thread-local root stacks are stable and fully describe all suspended-taskGcPtrsset_stw_reclaim_hook(f)— (Phase 10.2) installs a stop-the-world reclaim hook the JIT uses to free superseded native code; runs inside the STW guard at the tail of every collection (force_collect,gc_safepoint,async_gc_collect), when all mutator threads are parked
callback module
Thread-local eval context for Rust→Clojure callbacks (invoke, with_eval_context). The context is pushed automatically around native builtin calls and by the Tier-1 IR executor; rt_abi bridges (rt_call, rt_load_global, the HOF bridges) dispatch through it. Public API includes:
push_eval_context(env: &Env)/pop_eval_context()— bracket a native call with the current env's globals + namespacecapture_eval_context() -> Option<(Arc<GlobalEnv>, Arc<str>)>— snapshot the innermost context (e.g. to hand to another thread)install_eval_context(globals, ns)— push a previously captured context (spawned threads)install_eval_context_guard(globals, ns) -> EvalContextGuard— likeinstall_eval_context, but pops on drop (including unwind); used by the JIT-native dispatch seamcurrent_is_async() -> bool— whether the innermost context is inside an^:asyncbodyinvoke(f: &Value, args: Vec<Value>) -> ValueResult<Value>— call a Clojure-callable value through the innermost contextwith_eval_context(f)— run a closure with a temporaryEnvbuilt from the innermost context