NativeMemory.Clear(Void*, UIntPtr) 方法

定义

重要

此 API 不符合 CLS。

清除内存块。

public:
 static void Clear(void* ptr, UIntPtr byteCount);
[System.CLSCompliant(false)]
public static void Clear (void* ptr, UIntPtr byteCount);
[<System.CLSCompliant(false)>]
static member Clear : nativeptr<unit> * unativeint -> unit

参数

ptr
Void*

指向应清除的内存块的指针。

byteCount
UIntPtr

unativeint

要清除的块的大小(以字节为单位)。

属性

注解

如果调用此方法时为 ptrnullbyteCount0,则它等效于 no-op。

当 为 nullbyteCount 大于 0ptr的行为未定义。

适用于