validateAlignment static method
Validates the alignment of the given offset.
offset
: The offset to validate.alignment
: The required alignment.
Implementation
static void validateAlignment(int offset, int alignment) {
if (offset % alignment != 0) {
throw StateError(
'Misaligned memory access: offset $offset is not aligned to $alignment bytes');
}
}