File tree 4 files changed +9
-8
lines changed 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ extern crate test;
3
3
extern crate lwkt;
4
4
use lwkt:: { Context , StackSource } ;
5
5
6
- static mut ctx_slot: * mut Context = 0 as * mut Context ;
6
+ static mut ctx_slot: * mut Context < lwkt :: os :: Stack > = 0 as * mut Context < _ > ;
7
7
8
8
#[ bench]
9
9
fn context_new ( b : & mut test:: Bencher ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ extern crate test;
3
3
extern crate lwkt;
4
4
use lwkt:: { Context , StackSource } ;
5
5
6
- static mut ctx_slot: * mut Context = 0 as * mut Context ;
6
+ static mut ctx_slot: * mut Context < lwkt :: os :: Stack > = 0 as * mut Context < _ > ;
7
7
8
8
#[ bench]
9
9
fn swap ( b : & mut test:: Bencher ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ extern crate lwkt;
3
3
use lwkt:: { Context , StackSource } ;
4
4
5
5
#[ thread_local]
6
- static mut ctx_slot: * mut Context = 0 as * mut Context ;
6
+ static mut ctx_slot: * mut Context < lwkt :: os :: Stack > = 0 as * mut Context < _ > ;
7
7
8
8
fn main ( ) {
9
9
unsafe {
Original file line number Diff line number Diff line change 1
1
use core:: prelude:: * ;
2
2
use arch:: Registers ;
3
- use os ;
3
+ use stack ;
4
4
5
- pub struct Context {
5
+ pub struct Context < Stack : stack :: Stack > {
6
6
regs : Registers ,
7
- _stack : os :: Stack
7
+ _stack : Stack
8
8
}
9
9
10
- impl Context {
10
+ impl < Stack > Context < Stack > where Stack : stack :: Stack {
11
11
#[ inline]
12
- pub unsafe fn new < F > ( mut stack : os:: Stack , f : F ) -> Context where F : FnOnce ( ) + Send + ' static {
12
+ pub unsafe fn new < F > ( mut stack : Stack , f : F ) -> Context < Stack >
13
+ where F : FnOnce ( ) + Send + ' static {
13
14
let regs = Registers :: new ( & mut stack, f) ;
14
15
Context {
15
16
regs : regs,
You can’t perform that action at this time.
0 commit comments