CryptographicOperations.ZeroMemory(Span<Byte>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Fills the provided buffer with zeros.
public:
static void ZeroMemory(Span<System::Byte> buffer);
public static void ZeroMemory (Span<byte> buffer);
static member ZeroMemory : Span<byte> -> unit
Public Shared Sub ZeroMemory (buffer As Span(Of Byte))
Parameters
Remarks
This method exists to future-proof against potential optimizations in the .NET runtime that could eliminate memory writes that aren't followed by memory reads. While the C and C++ compilers have similar optimizations, no such optimizations are planned at this time for .NET.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.