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)
| 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 { |
no outgoing calls
no test coverage detected