(args: &[Val])
| 207 | struct TplEntry { args: Vec<Val>, result: Val, hits: u32, hash: u64 } |
| 208 | |
| 209 | fn 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. */ |
| 219 | fn args_memoizable(args: &[Val], heap: &super::types::HeapPool) -> bool { |