forked from M-Labs/libfringe
move os::Stack behind the facade, to OsStack
This commit is contained in:
parent
ff25697444
commit
fe490275fa
@ -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;
|
||||
|
@ -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!");
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user