Skip to content

Commit

Permalink
chore: fix some typos in comments (#429)
Browse files Browse the repository at this point in the history
Signed-off-by: oftenoccur <[email protected]>
  • Loading branch information
oftenoccur authored Apr 11, 2024
1 parent 655adda commit 13c0dd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/cost_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use crate::{
Instruction,
};

// Returns the spent cycles to execute the secific instruction.
// Returns the spent cycles to execute the specific instruction.
// This function is usually used to write test cases, which can visually
// display how many instructions are executed.
pub fn constant_cycles(_: Instruction) -> u64 {
1
}

// Returns the spent cycles to execute the secific instruction.
// Returns the spent cycles to execute the specific instruction.
// These values come from estimates of hardware execution speed.
pub fn estimate_cycles(i: Instruction) -> u64 {
match extract_opcode(i) {
Expand Down
6 changes: 3 additions & 3 deletions src/machine/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn check_memory_writable(
check_memory(machine, page);
machine.set_flag(page, FLAG_DIRTY)?;

// check next page if neccessary
// check next page if necessary
let page_offset = addr as usize % RISCV_PAGESIZE;
if page_offset + size > RISCV_PAGESIZE {
let page = page + 1;
Expand Down Expand Up @@ -161,7 +161,7 @@ fn check_memory_executable(
check_permission(machine, page, FLAG_EXECUTABLE)?;
check_memory(machine, page);

// check next page if neccessary
// check next page if necessary
let page_offset = addr as usize % RISCV_PAGESIZE;
if page_offset + size > RISCV_PAGESIZE {
let page = page + 1;
Expand Down Expand Up @@ -191,7 +191,7 @@ fn check_memory_inited(
}
check_memory(machine, page);

// check next page if neccessary
// check next page if necessary
let page_offset = addr as usize % RISCV_PAGESIZE;
if page_offset + size > RISCV_PAGESIZE {
let page = page + 1;
Expand Down

0 comments on commit 13c0dd9

Please sign in to comment.