Skip to content

Commit

Permalink
Replace uses std HashMap with hashbrown for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
domenukk committed Jul 12, 2024
1 parent 24aa640 commit d79c499
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 20 deletions.
3 changes: 2 additions & 1 deletion libafl/src/common/nautilus/grammartec/mutator.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use alloc::vec::Vec;
use std::{collections::HashSet, mem};
use core::mem;

use hashbrown::HashSet;
use libafl_bolts::{rands::Rand, Error};

use crate::common::nautilus::grammartec::{
Expand Down
3 changes: 2 additions & 1 deletion libafl/src/common/nautilus/grammartec/tree.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use alloc::vec::Vec;
use std::{cmp, collections::HashSet, io, io::Write, marker::Sized};
use std::{cmp, io, io::Write, marker::Sized};

use hashbrown::HashSet;
use libafl_bolts::rands::Rand;
use pyo3::{
prelude::{PyObject, PyResult, Python},
Expand Down
4 changes: 2 additions & 2 deletions libafl_frida/src/cmplog_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#[cfg(target_arch = "aarch64")]
use core::ffi::c_void;
#[cfg(all(feature = "cmplog", target_arch = "x86_64"))]
use std::collections::HashMap;
use std::rc::Rc;

use dynasmrt::dynasm;
Expand All @@ -23,6 +21,8 @@ use frida_gum::{
};
use frida_gum_sys::Insn;
#[cfg(all(feature = "cmplog", target_arch = "x86_64"))]
use hashbrown::HashMap;
#[cfg(all(feature = "cmplog", target_arch = "x86_64"))]
use iced_x86::{
BlockEncoder, Code, DecoderOptions, Instruction, InstructionBlock, MemoryOperand, MemorySize,
OpKind, Register,
Expand Down
3 changes: 2 additions & 1 deletion libafl_libfuzzer/libafl_libfuzzer_runtime/src/misc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::{
collections::{HashSet, VecDeque},
collections::VecDeque,
path::PathBuf,
};
use hashbrown::HashSet;

use libafl::{Error, HasMetadata};
use libafl_bolts::impl_serdeany;
Expand Down
4 changes: 2 additions & 2 deletions libafl_qemu/src/command/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#[cfg(emulation_mode = "systemmode")]
use std::collections::HashSet;
use std::{
fmt::{Debug, Display, Error, Formatter},
rc::Rc,
};

use enum_map::{Enum, EnumMap};
use hashbrown::HashMap;
#[cfg(emulation_mode = "systemmode")]
use hashbrown::HashSet;
use libafl::{
executors::ExitKind,
inputs::HasTargetBytes,
Expand Down
9 changes: 2 additions & 7 deletions libafl_qemu/src/helpers/asan.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#![allow(clippy::cast_possible_wrap)]

use std::{
borrow::Cow,
collections::{HashMap, HashSet},
env, fs,
path::PathBuf,
sync::Mutex,
};
use std::{borrow::Cow, env, fs, path::PathBuf, sync::Mutex};

use hashbrown::{HashMap, HashSet};
use libafl::{executors::ExitKind, inputs::UsesInput, observers::ObserversTuple, HasMetadata};
use libc::{
c_void, MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_NORESERVE, MAP_PRIVATE, PROT_READ, PROT_WRITE,
Expand Down
8 changes: 2 additions & 6 deletions libafl_qemu/src/helpers/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use std::{
cell::UnsafeCell,
collections::{HashMap, HashSet},
mem::MaybeUninit,
sync::Mutex,
};
use std::{cell::UnsafeCell, mem::MaybeUninit, sync::Mutex};

use hashbrown::{HashMap, HashSet};
use libafl::{inputs::UsesInput, HasMetadata};
use libafl_qemu_sys::{GuestAddr, MmapPerms};
use meminterval::{Interval, IntervalTree};
Expand Down

0 comments on commit d79c499

Please sign in to comment.