From 13c0dd998d7e42e9aff6b638df5e5786cd58b520 Mon Sep 17 00:00:00 2001 From: oftenoccur <166520808+oftenoccur@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:05:53 +0800 Subject: [PATCH] chore: fix some typos in comments (#429) Signed-off-by: oftenoccur --- src/cost_model.rs | 4 ++-- src/machine/asm/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cost_model.rs b/src/cost_model.rs index aa18586f..d2acb0bd 100644 --- a/src/cost_model.rs +++ b/src/cost_model.rs @@ -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) { diff --git a/src/machine/asm/mod.rs b/src/machine/asm/mod.rs index 8d47a5bf..668abd07 100644 --- a/src/machine/asm/mod.rs +++ b/src/machine/asm/mod.rs @@ -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; @@ -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; @@ -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;