Function kernel::grant::write_default_array

source ·
unsafe fn write_default_array<T: Default>(base: *mut T, num: usize)
Expand description

Write the default value of T to every element of the array.

§Safety

The pointer must be well aligned and point to allocated memory that is writable for size_of::<T> * num bytes. No Rust references may exist to memory in the address range spanned by base..base+num at the time this function is called. The memory does not need to be initialized yet. If it already does contain initialized memory, then those contents will be overwritten without being Droped first.