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.
This commit is contained in:
Andrew Kelley 2020-12-17 22:40:53 -07:00
parent 9b86dde7b9
commit ad05509930

View file

@ -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();