MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / init

Method init

hail-fuzz/src/coverage.rs:372–390  ·  view source on GitHub ↗
(vm: &mut Vm, bucket_strategy: BucketStrategy, pack_bits: bool)

Source from the content-addressed store, hash-verified

370
371impl 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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected