(group: &mut BenchmarkGroup<'_, WallTime>, backend: &str, make_memory: F)
| 15 | const CROSS_CHUNK_LEN: usize = CHUNK_SIZE * 2; |
| 16 | |
| 17 | fn bench_grow<M, F>(group: &mut BenchmarkGroup<'_, WallTime>, backend: &str, make_memory: F) |
| 18 | where |
| 19 | M: LinearMemory, |
| 20 | F: Fn() -> M + Copy, |
| 21 | { |
| 22 | group.bench_function(BenchmarkId::new("grow", backend), |b| { |
| 23 | b.iter_batched( |
| 24 | make_memory, |
| 25 | |mut memory| { |
| 26 | for page_count in 2..=GROW_STEPS + 1 { |
| 27 | memory.grow_to(page_count * PAGE_SIZE).unwrap(); |
| 28 | } |
| 29 | black_box(memory.len()) |
| 30 | }, |
| 31 | BatchSize::SmallInput, |
| 32 | ) |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | fn bench_write_all<M: LinearMemory>( |
| 37 | group: &mut BenchmarkGroup<'_, WallTime>, |
no test coverage detected