tari
tari copied to clipboard
Replace unsafe Send and Sync on RandomXVMInstance
Currently there are unsafe impls of these traits on RandomXVMInstance.
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl Send for RandomXVMInstance {}
unsafe impl Sync for RandomXVMInstance {}
While this allows the code to compile, I believe there is a better way to wrap these instances in a way that is more idiomatic to rust.
Already there was a panic, fixed by #5734 but there could be more unsafe problems
It could probably also benefit from a better readwrite lock implementation like tokio's.