@@ -352,19 +352,16 @@ impl_zeroize_with_default!(i8, i16, i32, i64, i128, isize);
352352impl_zeroize_with_default ! ( u8 , u16 , u32 , u64 , u128 , usize ) ;
353353impl_zeroize_with_default ! ( f32 , f64 , char , bool ) ;
354354
355- /// Implement `Zeroize` on arrays of types that can be zeroized with `Default`.
356- ///
357- /// This impl can eventually be optimized using an atomic memset intrinsic.
358- /// See notes for the blanket impl of `Zeroize` on `[Z]`.
355+ /// Implement `Zeroize` on arrays of types that impl `Zeroize`
359356macro_rules! impl_zeroize_for_array {
360357 ( $( $size: expr) ,+) => {
361358 $(
362359 impl <Z > Zeroize for [ Z ; $size]
363360 where
364- Z : DefaultIsZeroes
361+ Z : Zeroize
365362 {
366363 fn zeroize( & mut self ) {
367- self . as_mut ( ) . zeroize( ) ;
364+ self . iter_mut ( ) . zeroize( ) ;
368365 }
369366 }
370367 ) +
@@ -495,15 +492,12 @@ fn atomic_fence() {
495492}
496493
497494/// Perform a volatile write to the destination
498- // TODO(tarcieri): replace this with atomic writes when they're stable
499495#[ inline]
500496fn volatile_write < T : Copy + Sized > ( dst : & mut T , src : T ) {
501497 unsafe { ptr:: write_volatile ( dst, src) }
502498}
503499
504500/// Perform a volatile `memset` operation which fills a slice with a value
505- // TODO(tarcieri): use `llvm.memset.element.unordered.atomic`
506- // See: https://github.com/rust-lang/rust/issues/58599
507501#[ inline]
508502fn volatile_set < T : Copy + Sized > ( dst : & mut [ T ] , src : T ) {
509503 // TODO(tarcieri): use `volatile_set_memory` on nightly?
0 commit comments