Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsAligned

Returns true if the address represented by the pointer has a given alignment.
Read time 1 minuteLast updated 13 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

IsAligned(void*, int)

Returns true if the address represented by the pointer has a given alignment.
public static bool IsAligned(void* p, int alignmentPowerOfTwo)

Parameters

The pointer.

alignmentPowerOfTwo

A non-zero, positive power of two.

Returns

Type

Description

boolTrue if the address is a multiple of
alignmentPowerOfTwo
.

IsAligned(ulong, int)

Returns true if an offset has a given alignment.
public static bool IsAligned(ulong offset, int alignmentPowerOfTwo)

Parameters

offset

An offset

alignmentPowerOfTwo

A non-zero, positive power of two.

Returns

Type

Description

boolTrue if the offset is a multiple of
alignmentPowerOfTwo
.