util: remove unused function
This commit is contained in:
parent
879046ef83
commit
2f3fe5019b
1 changed files with 0 additions and 10 deletions
|
@ -20,13 +20,3 @@ const os = std.os;
|
||||||
|
|
||||||
/// The global general-purpose allocator used throughout river's code
|
/// The global general-purpose allocator used throughout river's code
|
||||||
pub const gpa = std.heap.c_allocator;
|
pub const gpa = std.heap.c_allocator;
|
||||||
|
|
||||||
/// Take a pointer to c_void and cast it to a pointer to T. This function
|
|
||||||
/// exists to avoid having the verbosity of the required alignment casts all
|
|
||||||
/// over the code.
|
|
||||||
pub fn voidCast(comptime T: type, ptr: anytype) *T {
|
|
||||||
// See https://github.com/ziglang/zig/issues/5618
|
|
||||||
if (@TypeOf(ptr) != *c_void)
|
|
||||||
@compileError("voidCast takes *c_void but " ++ @typeName(@TypeOf(ptr)) ++ " was provided");
|
|
||||||
return @ptrCast(*T, @alignCast(@alignOf(*T), ptr));
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue