MCPcopy Create free account
hub / github.com/argumentcomputer/ix / clear_reduction_caches

Method clear_reduction_caches

crates/kernel/src/env.rs:612–626  ·  view source on GitHub ↗

Clear only the reduction-memo caches (whnf / infer / def-eq / unfold / is-prop). Structural caches (`consts`, `blocks`, `intern`, recursor caches, `block_check_results`) and the profile sink are preserved. Used by the profile recorder's per-constant isolation mode: clearing the cross-constant memo between constants forces every delta-unfold to re-execute (sound delta recording) and makes recorded

(&mut self)

Source from the content-addressed store, hash-verified

610 /// no-ops; when set, the totals are dumped from the `Drop` impl below.
611 pub perf: PerfCounters,
612
613 /// Out-of-circuit profile recorder for sharding (see `plans/sharding.md`).
614 /// `Some` enables per-constant heartbeat + delta-unfold recording on this
615 /// worker; `None` (the default) has zero overhead. Deliberately preserved
616 /// across `clear`/`clear_releasing_memory` so recording survives scheduled
617 /// block boundaries within a run.
618 pub profile_sink: Option<crate::profile::ProfileSink>,
619}
620
621impl<M: KernelMode> Default for KEnv<M> {
622 fn default() -> Self {
623 Self::new()
624 }
625}
626
627/// Dump performance counters when the env is dropped, but only when
628/// `IX_PERF_COUNTERS=1` is set. Serial `FxHashMap` teardown is left to
629/// normal Rust drop order.

Callers 1

resetMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected