Skip to content

Commit

Permalink
docs: is_static doc driveby
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Apr 24, 2024
1 parent d9d9e84 commit 9ab5625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/interpreter/src/interpreter/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,11 @@ impl Stack {
}
// SAFETY: `n` and `n_m` are checked to be within bounds, and they don't overlap.
unsafe {
// NOTE: `mem::swap` performs better than `slice::swap`/`ptr::swap`, as they cannot
// assume that the pointers are non-overlapping when we know they are not.
// NOTE: `mem::swap` is more efficient than `slice::swap` or `ptr::swap` because it
// operates under the assumption that the pointers do not overlap,
// which is a condition we know to be true in this context.
let top = self.data.as_mut_ptr().add(len - 1);
#[allow(clippy::swap_ptr_to_ref)] // See above.
core::mem::swap(&mut *top.sub(n), &mut *top.sub(n_m_index));
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/interpreter/src/interpreter_action/call_inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct CallInputs {
///
/// Previously `context.scheme`.
pub scheme: CallScheme,
/// Whether the call is initiated inside a static call.
/// Whether the call is, or is initiated inside a static call.
pub is_static: bool,
/// Whether the call is initiated from EOF bytecode.
pub is_eof: bool,
Expand Down

0 comments on commit 9ab5625

Please sign in to comment.