Skip to content

Commit

Permalink
add some inline annotations in executor
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Mar 3, 2023
1 parent a28bba6 commit e00cfaa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/wasmi/src/engine/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ impl<'ctx, 'engine> Executor<'ctx, 'engine> {
///
/// - If the [`StoreInner`] ran out of fuel.
/// - If the `exec` closure traps.
#[inline(always)]
fn consume_fuel_on_success<T, E>(
&mut self,
delta: impl FnOnce(&FuelCosts) -> u64,
Expand Down Expand Up @@ -666,20 +667,23 @@ impl<'ctx, 'engine> Executor<'ctx, 'engine> {
}

/// Returns `true` if fuel metering is enabled.
#[inline(always)]
fn is_fuel_metering_enabled(&self) -> bool {
self.ctx.engine().config().get_consume_fuel()
}

/// Returns a shared reference to the [`FuelCosts`] of the [`Engine`].
///
/// [`Engine`]: crate::Engine
#[inline(always)]
fn fuel_costs(&self) -> &FuelCosts {
self.ctx.engine().config().fuel_costs()
}

/// Returns the [`FuelConsumptionMode`] of the [`Engine`].
///
/// [`Engine`]: crate::Engine
#[inline(always)]
fn get_fuel_consumption_mode(&self) -> FuelConsumptionMode {
self.ctx.engine().config().get_fuel_consumption_mode()
}
Expand Down

0 comments on commit e00cfaa

Please sign in to comment.