move constants to machine.rs

This commit is contained in:
Ralf Jung 2019-06-29 14:37:41 +02:00
parent c7bf9064f7
commit 019ad4bab4
2 changed files with 9 additions and 6 deletions

View File

@ -37,14 +37,12 @@ pub use crate::range_map::RangeMap;
pub use crate::helpers::{EvalContextExt as HelpersEvalContextExt};
pub use crate::mono_hash_map::MonoHashMap;
pub use crate::stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Tag, Permission, Stack, Stacks, Item};
pub use crate::machine::{MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt};
pub use crate::machine::{
PAGE_SIZE, STACK_ADDR, NUM_CPUS,
MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt,
};
pub use crate::eval::{eval_main, create_ecx, MiriConfig};
// Some global facts about the emulated machine.
pub const PAGE_SIZE: u64 = 4*1024;
pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations
pub const NUM_CPUS: u64 = 1;
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
/// set per default, for maximal validation power.
pub fn miri_default_args() -> &'static [&'static str] {

View File

@ -12,6 +12,11 @@ use rustc::mir;
use crate::*;
// Some global facts about the emulated machine.
pub const PAGE_SIZE: u64 = 4*1024; // FIXME: adjust to target architecture
pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations
pub const NUM_CPUS: u64 = 1;
/// Extra memory kinds
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum MiriMemoryKind {