fix: do not remove libc memmove until performance comparisons have been conducted
parent
1c0282d658
commit
ff3a6d0650
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue