diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-29 00:19:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 00:19:55 -0700 |
| commit | d65b42e07caa00dfe2f2fbf221c593ce57882784 (patch) | |
| tree | 7926cbea1499e0affe930bf6d7455dc24adf014e /lib/std/os/linux/tls.zig | |
| parent | fd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff) | |
| parent | fa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff) | |
| download | zig-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.zig | 4 |
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 |
