-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
The clear_on_drop crate is no longer maintained and uses fragile techniques. We expected it to break as linker optimizations work their way into rustc, etc. You should expose zeroing with the zeroize and if your dependencies do not yet support zeroing then you can implement the Zeroize
trait using a function like
#[inline(always)]
fn zeroize_hack<Z: Default>(z: &mut Z) {
use core::{ptr, sync::atomic};
unsafe { ptr::write_volatile(z, Z::default()); }
atomic::compiler_fence(atomic::Ordering::SeqCst);
}
lovesh
Metadata
Metadata
Assignees
Labels
No labels