Function assertAligned [src]
Invokes detectable illegal behavior when the provided array is not aligned
to the provided amount.
Prototype
pub fn assertAligned(ptr: anytype, comptime alignment: std.mem.Alignment) void
Parameters
alignment: std.mem.Alignment
Source
pub fn assertAligned(ptr: anytype, comptime alignment: std.mem.Alignment) void {
const aligned_ptr: *align(alignment.toByteUnits()) const anyopaque = @ptrCast(@alignCast(ptr));
_ = aligned_ptr;
}