Remove Rc wrapping of BuiltinFnPtr in BuiltinFn wrapper

I'm trying to remember why this was added in the first place - I think
to simplifly cloning? It's not important now though.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-01-24 17:53:29 -08:00
parent 070e497e1f
commit ea01f8e191
2 changed files with 4 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ pub enum BuiltinExit {
#[derive(Clone, Finalize)]
pub struct BuiltinFn {
name: Rc<String>,
fun: Rc<BuiltinFnPtr>,
fun: BuiltinFnPtr,
}
unsafe impl Trace for BuiltinFn {
@@ -100,7 +100,7 @@ impl PartialEq for BuiltinFn {
}
impl BuiltinFn {
pub fn new(name: String, fun: Rc<BuiltinFnPtr>) -> Self {
pub fn new(name: String, fun: BuiltinFnPtr) -> Self {
BuiltinFn {
name: Rc::new(name),
fun,
@@ -184,7 +184,7 @@ macro_rules! vtable {
macro_rules! builtin_fn {
($name:expr, $fun:expr) => {{
BuiltinFnObj::new(BuiltinFn::new($name.to_string(), Rc::new($fun))).into_gc()
BuiltinFnObj::new(BuiltinFn::new($name.to_string(), $fun)).into_gc()
}};
}

View File

@@ -332,7 +332,7 @@ impl MachineBuilder {
) {
self.register_global(
name,
BuiltinFnObj::new(BuiltinFn::new(name.to_string(), Rc::new(fun))).into_gc(),
BuiltinFnObj::new(BuiltinFn::new(name.to_string(), fun)).into_gc(),
);
}