From 7167b0b570c23fd0857fb487d592ef6202deaefa Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 15 Apr 2015 21:54:56 -0400 Subject: [PATCH] add Context::destroy --- src/context.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 + } }