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

Method max

crates/kernel/src/env.rs:176–203  ·  view source on GitHub ↗

Largest single cache size. Cheap proxy for "how big did this block get" without summing. (Sum is misleading because the same content hash can appear in multiple caches.)

(&self)

Source from the content-addressed store, hash-verified

174 }
175 }
176
177 /// Read-only fast path: return the canonical interned universe for
178 /// `key` if already present. The key must be built from CANONICAL
179 /// children (their uids). Plain callers should use `intern_univ`.
180 #[inline]
181 pub fn try_get_univ(&self, key: &UnivKey) -> Option<KUniv<M>> {
182 self.univs.get(key).cloned()
183 }
184
185 /// Read-only fast path counterpart of `try_get_univ` for expressions.
186 #[inline]
187 pub fn try_get_expr(&self, key: &ExprKey) -> Option<KExpr<M>> {
188 self.exprs.get(key).cloned()
189 }
190
191 /// Intern a universe: returns the canonical value for its structural
192 /// identity, recursively canonicalizing children as needed so the
193 /// shallow key is meaningful.
194 pub fn intern_univ(&mut self, u: KUniv<M>) -> KUniv<M> {
195 use super::level::UnivData;
196 crate::profile::bump_intern_nodes();
197 if self.canon_univs.contains(u.addr()) {
198 return u;
199 }
200 // Canonicalize children first; rebuild only if any child changed.
201 let u = match u.data() {
202 UnivData::Succ(inner, _) => {
203 let ci = self.intern_univ(inner.clone());
204 if ci.ptr_eq(inner) {
205 u
206 } else {

Callers 15

check_block_bodyMethod · 0.45
next_u32Method · 0.45
compute_nat_binFunction · 0.45
mergeMethod · 0.45
ingress_univFunction · 0.45
ingress_exprFunction · 0.45
def_eq_ctx_keyMethod · 0.45
ctx_addr_for_lbrMethod · 0.45
from_id_classesMethod · 0.45
partition_with_treeMethod · 0.45
agg_planFunction · 0.45
rec_bisectFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected