MCPcopy Create free account
hub / github.com/PLSysSec/wave / trial_1_safe

Function trial_1_safe

src/tests/memwrite_experiment.rs:126–138  ·  view source on GitHub ↗

Testing 32 bit writes using safe method vs unsafe method

()

Source from the content-addressed store, hash-verified

124
125// Testing 32 bit writes using safe method vs unsafe method
126fn trial_1_safe(){
127 let ctx = fresh_ctx();
128 let total_time = 0;
129 // Run 1000 trials
130 for idx in 0..1000{
131 let addr = idx * 8;
132 let now = Instant::now();
133 write_method_1_u32(ctx, 1337, addr);
134 let time = now.elapsed().as_nanos();
135 total_time += time;
136 }
137 println!("Average safe 32-bit write delay: {:?}", total_time / 1000);
138}
139
140fn trial_1_unsafe(){
141 let ctx = fresh_ctx();

Callers

nothing calls this directly

Calls 2

fresh_ctxFunction · 0.85
write_method_1_u32Function · 0.85

Tested by

no test coverage detected