Aligns a given pointer value to a specified alignment factor. Returns an aligned pointer or null if one of the following conditions is met:
pub fn alignPointer(ptr: anytype, align_to: usize) ?@TypeOf(ptr)
pub fn alignPointer(ptr: anytype, align_to: usize) ?@TypeOf(ptr) {
const adjust_off = alignPointerOffset(ptr, align_to) orelse return null;
// Avoid the use of ptrFromInt to avoid losing the pointer provenance info.
return @alignCast(ptr + adjust_off);
}