Add cache clearing to stop the memory leak (#1106)

* Add cache clearing

* Add TODO comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-04-09 23:30:57 +01:00
committed by GitHub
parent 8677981ceb
commit 4a39a94534
4 changed files with 51 additions and 18 deletions

View File

@@ -34,7 +34,12 @@ where
Box::new(self.node.eval(*input))
}
}
fn reset(self: std::pin::Pin<&mut Self>) {
let wrapped_node = unsafe { self.map_unchecked_mut(|e| &mut e.node) };
Node::reset(wrapped_node);
}
}
impl<_I, _O, S0> DynAnyRefNode<_I, _O, S0> {
pub const fn new(node: S0) -> Self {
Self { node, _i: core::marker::PhantomData }