Edit

Share via


RuntimeHelpers.SizeOf(RuntimeTypeHandle) Method

Definition

Gets the size of an object of the given type.

C#
public static int SizeOf(RuntimeTypeHandle type);

Parameters

type
RuntimeTypeHandle

The type to get the size of.

Returns

The size of instances of the type.

Exceptions

The passed-in type is not a valid type to get the size of.

Remarks

This API returns the same value as SizeOf<T>() for the type that type represents.

Applies to

Product Versions
.NET 9, 10