(vm: &mut Vm, bucket_strategy: BucketStrategy, pack_bits: bool)
| 370 | |
| 371 | impl BlockCoverage { |
| 372 | pub fn init(vm: &mut Vm, bucket_strategy: BucketStrategy, pack_bits: bool) -> Self { |
| 373 | if pack_bits && !matches!(bucket_strategy, BucketStrategy::Any) { |
| 374 | panic!("cannot use bit packed with bucket strategy of: {bucket_strategy:?}"); |
| 375 | } |
| 376 | |
| 377 | let (injector, storage) = match bucket_strategy { |
| 378 | BucketStrategy::Any if pack_bits => ExactBlockCoverageInjector::register(vm), |
| 379 | _ => ExactBlockCountCoverageInjector::register(vm), |
| 380 | }; |
| 381 | Self { |
| 382 | injector, |
| 383 | storage, |
| 384 | count: 0, |
| 385 | hit: vec![0; 128], |
| 386 | mapping_cache: RefCell::new(vec![]), |
| 387 | bucket_strategy, |
| 388 | pack_bits, |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | pub fn get_blocks(&self, vm: &mut Vm) -> Vec<u64> { |
| 393 | self.update_mapping_cache(vm); |
nothing calls this directly
no outgoing calls
no test coverage detected