mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-22 12:50:46 +00:00
fix: do not remove libc memmove until performance comparisons have been conducted
This commit is contained in:
@@ -2,10 +2,14 @@ const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const assert = std.debug.assert;
|
||||
|
||||
/// Same as std.mem.copyForwards/Backwards but prefers libc memmove if it is
|
||||
/// available because it is generally much faster.
|
||||
/// Same as @memmove but prefers libc memmove if it is
|
||||
/// available because it is generally much faster?.
|
||||
pub inline fn move(comptime T: type, dest: []T, source: []const T) void {
|
||||
@memmove(dest, source);
|
||||
if (builtin.link_libc) {
|
||||
_ = memmove(dest.ptr, source.ptr, source.len * @sizeOf(T));
|
||||
} else {
|
||||
@memmove(dest, source);
|
||||
}
|
||||
}
|
||||
|
||||
/// Same as @memcpy but prefers libc memcpy if it is available
|
||||
|
||||
Reference in New Issue
Block a user