@@ -352,19 +352,16 @@ impl_zeroize_with_default!(i8, i16, i32, i64, i128, isize);
352
352
impl_zeroize_with_default ! ( u8 , u16 , u32 , u64 , u128 , usize ) ;
353
353
impl_zeroize_with_default ! ( f32 , f64 , char , bool ) ;
354
354
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`
359
356
macro_rules! impl_zeroize_for_array {
360
357
( $( $size: expr) ,+) => {
361
358
$(
362
359
impl <Z > Zeroize for [ Z ; $size]
363
360
where
364
- Z : DefaultIsZeroes
361
+ Z : Zeroize
365
362
{
366
363
fn zeroize( & mut self ) {
367
- self . as_mut ( ) . zeroize( ) ;
364
+ self . iter_mut ( ) . zeroize( ) ;
368
365
}
369
366
}
370
367
) +
@@ -495,15 +492,12 @@ fn atomic_fence() {
495
492
}
496
493
497
494
/// Perform a volatile write to the destination
498
- // TODO(tarcieri): replace this with atomic writes when they're stable
499
495
#[ inline]
500
496
fn volatile_write < T : Copy + Sized > ( dst : & mut T , src : T ) {
501
497
unsafe { ptr:: write_volatile ( dst, src) }
502
498
}
503
499
504
500
/// 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
507
501
#[ inline]
508
502
fn volatile_set < T : Copy + Sized > ( dst : & mut [ T ] , src : T ) {
509
503
// TODO(tarcieri): use `volatile_set_memory` on nightly?
0 commit comments