zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ad055099309d0faeb2725764ec441b1ee847ecbf (tree)
parent 9b86dde7b989172329d02092f42a94889b5b0d94
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 17 Dec 2020 22:40:53 -0700

std: align(16) main_thread_tls_buffer

Before this change, thread local variables were landmines if LLVM
decided to optimize any writes to them using vector instructions.

Diffstat:
Mlib/std/os/linux/tls.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig @@ -327,7 +327,7 @@ pub fn prepareTLS(area: []u8) usize { if (tls_tp_points_past_tcb) tls_image.data_offset else tls_image.tcb_offset; } -var main_thread_tls_buffer: [256]u8 = undefined; +var main_thread_tls_buffer: [256]u8 align(16) = undefined; pub fn initStaticTLS() void { initTLS();