Function CloneIntoHeap
@@ -3,6 +3,7 @@ use std::hash::{Hash, Hasher};
use std::sync::Arc;
use crate::code::Code;
+use crate::heap::{CloneIntoHeap, Heap};
use crate::process::stack::frame::Frame;
use crate::process::ModuleFunctionArity;
use crate::term::{Tag, Term};
@@ -50,6 +51,12 @@ impl Function {
}
}
+impl CloneIntoHeap for &'static Function {
+ fn clone_into_heap(&self, heap: &Heap) -> Self {
+ heap.function(self.module_function_arity.clone(), self.code)
+ }
+}
+
impl Eq for Function {}
impl Hash for Function {
