Skip to content

Commit f6d6709

Browse files
committed
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.
1 parent 5828e0d commit f6d6709

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/os/linux/tls.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ pub fn prepareTLS(area: []u8) usize {
327327
if (tls_tp_points_past_tcb) tls_image.data_offset else tls_image.tcb_offset;
328328
}
329329

330-
var main_thread_tls_buffer: [256]u8 = undefined;
330+
var main_thread_tls_buffer: [256]u8 align(16) = undefined;
331331

332332
pub fn initStaticTLS() void {
333333
initTLS();

0 commit comments

Comments
 (0)