MCPcopy Create free account
hub / github.com/RustCrypto/utils / volatile_fill_slice

Function volatile_fill_slice

zeroize/src/bulk.rs:64–74  ·  view source on GitHub ↗
(dst: &mut [T], src: T)

Source from the content-addressed store, hash-verified

62/// Fill a slice with a repeated value, preserving its type and alignment.
63#[inline(always)]
64fn volatile_fill_slice<T: Copy>(dst: &mut [T], src: T) {
65 // Target 16-byte chunks
66 match size_of::<T>() {
67 0 => {}
68 1 => volatile_fill_chunked::<_, 16>(dst, src),
69 2 => volatile_fill_chunked::<_, 8>(dst, src),
70 4 => volatile_fill_chunked::<_, 4>(dst, src),
71 8 => volatile_fill_chunked::<_, 2>(dst, src),
72 _ => volatile_fill_iterative(dst, src),
73 }
74}
75
76/// Prepare the repeated pattern and handle the tail independently of the bulk backend.
77#[inline(always)]

Callers 2

fill_sliceFunction · 0.85
zeroize_byte_ptrFunction · 0.85

Calls 1

volatile_fill_iterativeFunction · 0.85

Tested by

no test coverage detected