diff --git a/Cargo.toml b/Cargo.toml index 64552d11..f859dcee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,12 +17,17 @@ generic-array = "0.8.2" lazy_static = "0.2.8" libc = "0.2" matches = "0.1.6" -region = "0.0.6" slice-pool = "0.3.3" +[dependencies.region] +git = "https://github.com/darfink/region-rs.git" + [dependencies.mmap] git = "https://github.com/retep998/rust-mmap.git" +[dev-dependencies] +volatile_cell = "1.0.0" + [target] [target."cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))".dependencies] diff --git a/tests/lib.rs b/tests/lib.rs index 5b61d14d..05ecd838 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,14 +1,18 @@ extern crate detour; +extern crate volatile_cell; use std::mem; +use volatile_cell::VolatileCell; type FnAdd = extern "C" fn(i32, i32) -> i32; +#[inline(never)] extern "C" fn add(x: i32, y: i32) -> i32 { - x + y + VolatileCell::new(x).get() + y } +#[inline(never)] extern "C" fn sub_detour(x: i32, y: i32) -> i32 { - x - y + VolatileCell::new(x).get() - y } #[test]