isAligned static method

bool isAligned(
  1. int offset,
  2. int alignment
)

Verify if an offset is properly aligned

  • offset: The current offset
  • alignment: The alignment boundary Returns true if the offset is properly aligned, false otherwise

Implementation

static bool isAligned(int offset, int alignment) {
  return offset % alignment == 0;
}