From fe490275fa38bb863a33b9c3b1fe0f5eabff4d06 Mon Sep 17 00:00:00 2001 From: edef Date: Thu, 16 Apr 2015 07:44:07 -0400 Subject: [PATCH] move os::Stack behind the facade, to OsStack --- benches/swap.rs | 4 ++-- examples/basic.rs | 4 ++-- src/lib.rs | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/benches/swap.rs b/benches/swap.rs index 1d113c4..a0456c6 100644 --- a/benches/swap.rs +++ b/benches/swap.rs @@ -5,12 +5,12 @@ extern crate test; extern crate lwkt; use lwkt::Context; -static mut ctx_slot: *mut Context<'static, lwkt::os::Stack> = 0 as *mut Context<_>; +static mut ctx_slot: *mut Context<'static, lwkt::OsStack> = 0 as *mut Context<_>; #[bench] fn swap(b: &mut test::Bencher) { unsafe { - let stack = lwkt::os::Stack::new(4 << 20).unwrap(); + let stack = lwkt::OsStack::new(4 << 20).unwrap(); let mut ctx = Context::new(stack, move || { let ctx_ptr = ctx_slot; diff --git a/examples/basic.rs b/examples/basic.rs index fabb7be..d1cb6d7 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -3,11 +3,11 @@ extern crate lwkt; use lwkt::Context; #[thread_local] -static mut ctx_slot: *mut Context<'static, lwkt::os::Stack> = 0 as *mut Context<_>; +static mut ctx_slot: *mut Context<'static, lwkt::OsStack> = 0 as *mut Context<_>; fn main() { unsafe { - let stack = lwkt::os::Stack::new(4 << 20).unwrap(); + let stack = lwkt::OsStack::new(4 << 20).unwrap(); let mut ctx = Context::new(stack, move || { println!("it's alive!"); diff --git a/src/lib.rs b/src/lib.rs index 83fa1e6..554e9df 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,8 @@ extern crate std; pub use context::Context; pub use stack::Stack; +#[cfg(feature = "os")] +pub use os::Stack as OsStack; #[cfg(not(test))] mod std { pub use core::*; } @@ -26,4 +28,4 @@ mod debug; mod arch; #[cfg(feature = "os")] -pub mod os; +mod os;