aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux/tls.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-29 00:19:55 -0700
committerGitHub <noreply@github.com>2023-04-29 00:19:55 -0700
commitd65b42e07caa00dfe2f2fbf221c593ce57882784 (patch)
tree7926cbea1499e0affe930bf6d7455dc24adf014e /lib/std/os/linux/tls.zig
parentfd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff)
parentfa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff)
downloadzig-d65b42e07caa00dfe2f2fbf221c593ce57882784.tar.gz
zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.zip
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
Diffstat (limited to 'lib/std/os/linux/tls.zig')
-rw-r--r--lib/std/os/linux/tls.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig
index cffdec0424..311e5609e8 100644
--- a/lib/std/os/linux/tls.zig
+++ b/lib/std/os/linux/tls.zig
@@ -275,7 +275,7 @@ inline fn alignPtrCast(comptime T: type, ptr: [*]u8) *T {
/// architecture-specific value of the thread-pointer register
pub fn prepareTLS(area: []u8) usize {
// Clear the area we're going to use, just to be safe
- mem.set(u8, area, 0);
+ @memset(area, 0);
// Prepare the DTV
const dtv = alignPtrCast(DTV, area.ptr + tls_image.dtv_offset);
dtv.entries = 1;
@@ -287,7 +287,7 @@ pub fn prepareTLS(area: []u8) usize {
.VariantII => area.ptr + tls_image.tcb_offset,
};
// Copy the data
- mem.copy(u8, area[tls_image.data_offset..], tls_image.init_data);
+ @memcpy(area[tls_image.data_offset..][0..tls_image.init_data.len], tls_image.init_data);
// Return the corrected value (if needed) for the tp register.
// Overflow here is not a problem, the pointer arithmetic involving the tp