Edit

Share via


RuntimeHelpers.AllocateTypeAssociatedMemory(Type, Int32) Method

Definition

Allocates memory that's associated with the type and is freed if and when the Type is unloaded.

public static IntPtr AllocateTypeAssociatedMemory(Type type, int size);

Parameters

type
Type

The type associated with the allocated memory.

size
Int32

The amount of memory to allocate, in bytes.

Returns

IntPtr

The allocated memory.

Applies to

Product Versions
.NET 5, 6, 7, 8, 9, 10