Skip to content

Commit a6de443

Browse files
committed
Pay extra
1 parent 499bce5 commit a6de443

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/cache.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,17 @@ where
113113
if i != u32::MAX {
114114
return cache.0.read().values[i as usize].clone();
115115
}
116-
let value = func(input.retrack_noop());
116+
117+
// Execute the function with the new constraints hooked in.
118+
let sink = |call: In::Call, hash: u128| {
119+
if call.is_mutable() {
120+
list.lock().mutable.push(call);
121+
true
122+
} else {
123+
list.lock().immutable.insert(call, hash)
124+
}
125+
};
126+
let value = func(input.retrack(sink, bump));
117127
cache.0.write().values.push(value.clone());
118128
return value;
119129
}

0 commit comments

Comments
 (0)