[]
        
(Showing Draft Content)

C1.Util.DX.DXUtil.AllocateClearedMemory

AllocateClearedMemory Method

AllocateClearedMemory(int, byte, int)

Allocate an aligned memory buffer and clear it with a specified value (0 by default).

Declaration
public static nint AllocateClearedMemory(int sizeInBytes, byte clearValue = 0, int align = 16)
Public Shared Function AllocateClearedMemory(sizeInBytes As Integer, Optional clearValue As Byte = 0, Optional align As Integer = 16) As IntPtr
Parameters
Type Name Description
int sizeInBytes

Size of the buffer to allocate.

byte clearValue

Default value used to clear the buffer.

int align

Alignment, 16 bytes by default.

Returns
Type Description
nint

A pointer to a buffer aligned.

Remarks

To free this buffer, call FreeMemory(nint).