Upraviť

Zdieľať cez


CryptographicOperations.ZeroMemory(Span<Byte>) Method

Definition

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

buffer
Span<Byte>

The buffer to fill with zeros.

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