diff --git a/src/context.rs b/src/context.rs index d322ba8..51362fb 100644 --- a/src/context.rs +++ b/src/context.rs @@ -4,7 +4,7 @@ use stack; pub struct Context { regs: Registers, - _stack: Stack + stack: Stack } impl Context where Stack: stack::Stack { @@ -14,7 +14,7 @@ impl Context where Stack: stack::Stack { let regs = Registers::new(&mut stack, f); Context { regs: regs, - _stack: stack + stack: stack } } @@ -22,4 +22,8 @@ impl Context where Stack: stack::Stack { pub unsafe fn swap(&mut self) { self.regs.swap() } + + pub unsafe fn destroy(self) -> Stack { + self.stack + } }