fn alignPointer(ptr: anytype, align_to: usize) ?@TypeOf(ptr)

Aligns a given pointer value to a specified alignment factor. Returns an aligned pointer or null if one of the following conditions is met:

  • The aligned pointer would not fit the address space,
  • The delta required to align the pointer is not a multiple of the pointee’s type.

Parameters

ptr: anytype,
align_to: usize,