Closed yfractal closed 3 weeks ago
For example:
fn ruby_insert(key: RString, obj: AnyObject) -> AnyObject { let struct = rtself.get_data_mut(&*STORE_WRAPPER); let ruby_obj = RubyObject::from(obj.unwrap().value()); struct .hash_map .insert(key.unwrap().to_string(), Arc::new(ruby_obj)); NilClass::new().into() },
I think I have to pin the object first to avoid the memory being moved and then keep a reference in rtself to avoid the memory has been freed.
rtself
Are there any other things I need to do?
For example:
I think I have to pin the object first to avoid the memory being moved and then keep a reference in
rtself
to avoid the memory has been freed.Are there any other things I need to do?