more inlines

This commit is contained in:
Dominik Maier 2020-12-11 01:12:00 +01:00
parent 1af7b204bc
commit ec6512d49c
3 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,8 @@ impl<I> Executor<I> for InMemoryExecutor<I>
where
I: Input + HasTargetBytes,
{
#[inline]
fn run_target(&mut self, input: &I) -> Result<ExitKind, AflError> {
let bytes = input.target_bytes();
unsafe {
@ -38,10 +40,12 @@ where
Ok(ret)
}
#[inline]
fn observers(&self) -> &NamedSerdeAnyMap {
&self.observers
}
#[inline]
fn observers_mut(&mut self) -> &mut NamedSerdeAnyMap {
&mut self.observers
}

View File

@ -36,12 +36,14 @@ where
}
/// Reset the state of all the observes linked to this executor
#[inline]
fn reset_observers(&mut self) -> Result<(), AflError> {
self.observers_mut().for_each_mut(|_, x| Ok(x.reset()?))?;
Ok(())
}
/// Run the post exec hook for all the observes linked to this executor
#[inline]
fn post_exec_observers(&mut self) -> Result<(), AflError> {
self.observers_mut()
.for_each_mut(|_, x| Ok(x.post_exec()?))?;

View File

@ -59,6 +59,8 @@ impl<T> Reducer<T> for MaxReducer<T>
where
T: Integer + Copy + 'static,
{
#[inline]
fn reduce(first: T, second: T) -> T {
if first > second {
first
@ -79,6 +81,8 @@ impl<T> Reducer<T> for MinReducer<T>
where
T: Integer + Copy + 'static,
{
#[inline]
fn reduce(first: T, second: T) -> T {
if first < second {
first
@ -132,6 +136,7 @@ where
Ok(interesting)
}
#[inline]
fn name(&self) -> &String {
&self.name
}