Skip to content

Commit

Permalink
add 1 cost for wasm function (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity authored Oct 25, 2023
1 parent 61be533 commit 7bac965
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ fn inject_metering(
// Finding injection points
let mut injection_points = vec![];
let mut curr = InjectionPoint::new();
// each function has at least a unit cost
if seq_id == start && use_new_metering {
curr.cost += 1;
}
for (pos, (instr, _)) in seq.instrs.iter().enumerate() {
curr.position = pos;
match instr {
Expand Down

0 comments on commit 7bac965

Please sign in to comment.