MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / hash_args

Function hash_args

compiler/src/modules/vm/cache.rs:209–216  ·  view source on GitHub ↗
(args: &[Val])

Source from the content-addressed store, hash-verified

207struct TplEntry { args: Vec<Val>, result: Val, hits: u32, hash: u64 }
208
209fn hash_args(args: &[Val]) -> u64 {
210 let mut h: u64 = 0xcbf29ce484222325;
211 for v in args {
212 h ^= v.0;
213 h = h.wrapping_mul(0x100000001b3);
214 }
215 h
216}
217
218/* Memoize only when every arg is immutable; mutable containers hash by heap idx and go stale. */
219fn args_memoizable(args: &[Val], heap: &super::types::HeapPool) -> bool {

Callers 2

lookupMethod · 0.85
recordMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected