forked from M-Labs/libfringe
add Context::destroy
This commit is contained in:
parent
31652d7b8f
commit
7167b0b570
|
@ -4,7 +4,7 @@ use stack;
|
|||
|
||||
pub struct Context<Stack: stack::Stack> {
|
||||
regs: Registers,
|
||||
_stack: Stack
|
||||
stack: Stack
|
||||
}
|
||||
|
||||
impl<Stack> Context<Stack> where Stack: stack::Stack {
|
||||
|
@ -14,7 +14,7 @@ impl<Stack> Context<Stack> where Stack: stack::Stack {
|
|||
let regs = Registers::new(&mut stack, f);
|
||||
Context {
|
||||
regs: regs,
|
||||
_stack: stack
|
||||
stack: stack
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,4 +22,8 @@ impl<Stack> Context<Stack> where Stack: stack::Stack {
|
|||
pub unsafe fn swap(&mut self) {
|
||||
self.regs.swap()
|
||||
}
|
||||
|
||||
pub unsafe fn destroy(self) -> Stack {
|
||||
self.stack
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue