Skip to content

Commit 019ad4b

Browse files
committed
move constants to machine.rs
1 parent c7bf906 commit 019ad4b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ pub use crate::range_map::RangeMap;
3737
pub use crate::helpers::{EvalContextExt as HelpersEvalContextExt};
3838
pub use crate::mono_hash_map::MonoHashMap;
3939
pub use crate::stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Tag, Permission, Stack, Stacks, Item};
40-
pub use crate::machine::{MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt};
40+
pub use crate::machine::{
41+
PAGE_SIZE, STACK_ADDR, NUM_CPUS,
42+
MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt,
43+
};
4144
pub use crate::eval::{eval_main, create_ecx, MiriConfig};
4245

43-
// Some global facts about the emulated machine.
44-
pub const PAGE_SIZE: u64 = 4*1024;
45-
pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations
46-
pub const NUM_CPUS: u64 = 1;
47-
4846
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
4947
/// set per default, for maximal validation power.
5048
pub fn miri_default_args() -> &'static [&'static str] {

src/machine.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ use rustc::mir;
1212

1313
use crate::*;
1414

15+
// Some global facts about the emulated machine.
16+
pub const PAGE_SIZE: u64 = 4*1024; // FIXME: adjust to target architecture
17+
pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations
18+
pub const NUM_CPUS: u64 = 1;
19+
1520
/// Extra memory kinds
1621
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
1722
pub enum MiriMemoryKind {

0 commit comments

Comments
 (0)