pub fn assertAligned(ptr: anytype, comptime alignment: std.mem.Alignment) void
Invokes detectable illegal behavior when the provided array is not aligned to the provided amount.
ptr
alignment: std.mem.Alignment
454 455 456 457
pub fn assertAligned(ptr: anytype, comptime alignment: std.mem.Alignment) void { const aligned_ptr: *align(alignment.toByteUnits()) const anyopaque = @ptrCast(@alignCast(ptr)); _ = aligned_ptr; }
Invokes detectable illegal behavior when the provided array is not aligned to the provided amount.