mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.debug.assertAligned: support const pointers
This commit is contained in:
parent
5701617b27
commit
04bd30f021
1 changed files with 1 additions and 1 deletions
|
|
@ -569,7 +569,7 @@ pub fn assertReadable(slice: []const volatile u8) void {
|
|||
/// Invokes detectable illegal behavior when the provided array is not aligned
|
||||
/// to the provided amount.
|
||||
pub fn assertAligned(ptr: anytype, comptime alignment: std.mem.Alignment) void {
|
||||
const aligned_ptr: *align(alignment.toByteUnits()) anyopaque = @ptrCast(@alignCast(ptr));
|
||||
const aligned_ptr: *align(alignment.toByteUnits()) const anyopaque = @ptrCast(@alignCast(ptr));
|
||||
_ = aligned_ptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue