Редагувати

Поділитися через


Unsafe.InitBlock Method

Definition

Overloads

InitBlock(Void*, Byte, UInt32)

Initializes a block of memory at the given location with a given initial value.

InitBlock(Byte, Byte, UInt32)

Initializes a block of memory at the given location with a given initial value.

InitBlock(Void*, Byte, UInt32)

Source:
Unsafe.cs
Source:
Unsafe.cs
Source:
Unsafe.cs

Important

This API is not CLS-compliant.

Initializes a block of memory at the given location with a given initial value.

public:
 static void InitBlock(void* startAddress, System::Byte value, System::UInt32 byteCount);
public static void InitBlock (void* startAddress, byte value, uint byteCount);
[System.CLSCompliant(false)]
public static void InitBlock (void* startAddress, byte value, uint byteCount);
static member InitBlock : nativeptr<unit> * byte * uint32 -> unit
[<System.CLSCompliant(false)>]
static member InitBlock : nativeptr<unit> * byte * uint32 -> unit

Parameters

startAddress
Void*

The unmanaged pointer referencing the start of the memory block to initialize.

value
Byte

The value to initialize all bytes of the memory block to.

byteCount
UInt32

The number of bytes to initialize.

Attributes

Remarks

This API corresponds to the initblk opcode. The startAddress pointer is assumed to be pointer-aligned. See ECMA-335, Sec. III.3.36 ("initblk - initialize a block of memory to a value") for more information.

Caution

This API is not intended for initializing arbitrary-length runs of memory. Consider instead using Fill for this scenario.

Applies to

InitBlock(Byte, Byte, UInt32)

Source:
Unsafe.cs
Source:
Unsafe.cs
Source:
Unsafe.cs

Important

This API is not CLS-compliant.

Initializes a block of memory at the given location with a given initial value.

public:
 static void InitBlock(System::Byte % startAddress, System::Byte value, System::UInt32 byteCount);
public static void InitBlock (ref byte startAddress, byte value, uint byteCount);
[System.CLSCompliant(false)]
public static void InitBlock (ref byte startAddress, byte value, uint byteCount);
static member InitBlock : byte * byte * uint32 -> unit
[<System.CLSCompliant(false)>]
static member InitBlock : byte * byte * uint32 -> unit
Public Shared Sub InitBlock (ByRef startAddress As Byte, value As Byte, byteCount As UInteger)

Parameters

startAddress
Byte

The managed pointer referencing the start of the memory block to initialize.

value
Byte

The value to initialize all bytes of the memory block to.

byteCount
UInt32

The number of bytes to initialize.

Attributes

Remarks

This API corresponds to the initblk opcode. The startAddress pointer is assumed to be pointer-aligned. See ECMA-335, Sec. III.3.36 ("initblk - initialize a block of memory to a value") for more information.

Caution

This API is not intended for initializing arbitrary-length runs of memory. Consider instead using Fill for this scenario.

Applies to