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:
@@ -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()
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user