# IsAligned

> Returns true if the address represented by the pointer has a given alignment.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## IsAligned(void\*, int)

Returns true if the address represented by the pointer has a given alignment.

```csharp
public static bool IsAligned(void* p, int alignmentPowerOfTwo)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): The pointer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A non-zero, positive power of two.

### Returns

| Type                                                          | Description                                                 |
| ------------------------------------------------------------- | ----------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the address is a multiple of `alignmentPowerOfTwo`. |

## IsAligned(ulong, int)

Returns true if an offset has a given alignment.

```csharp
public static bool IsAligned(ulong offset, int alignmentPowerOfTwo)
```

### Parameters

**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): An offset**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A non-zero, positive power of two.

### Returns

| Type                                                          | Description                                                |
| ------------------------------------------------------------- | ---------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the offset is a multiple of `alignmentPowerOfTwo`. |
