# Sandbox.SandboxSystemExtensions.GetManagedSize

```csharp
static int GetManagedSize(System.Type t)
```

Get the managed size of a given type. This matches an IL-level sizeof(t), even if it cannot be determined normally in C#.
Note that `sizeof(t) != Marshal.SizeOf(t)` when t is char or bool.

## Remarks

An IL-level `sizeof(t)` will return `sizeof(IntPtr)` for reference types, as it refers to the size on stack or in an object,
not the size on heap.

### Parameters

- `t` (`System.Type`)

### Returns

`int`

Declared in [Sandbox.SandboxSystemExtensions](/api/Sandbox.SandboxSystemExtensions).
Assembly: `Sandbox.System`.
