authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-03 19:55:44+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-03 20:47:08+02:00
logc2fcdc21c27803e5cbb6dfcb6f61aa0905f6df38
tree66eb9b40c90bb587c007268ffa83280da374c9b7
parent8056a851517cd92590ddb9a4b76ce7b1f4aeb242
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.windows.tls: Change type of `_tls_start`/`_tls_end` to `*anyopaque`.

If they're typed as `u8`, they can be aligned to anything. We want at least pointer size alignment.

1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/os/windows/tls.zig+4-4
...@@ -2,8 +2,8 @@ const std = @import("std");...@@ -2,8 +2,8 @@ const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
33
4export var _tls_index: u32 = std.os.windows.TLS_OUT_OF_INDEXES;4export var _tls_index: u32 = std.os.windows.TLS_OUT_OF_INDEXES;
5export var _tls_start: u8 linksection(".tls") = 0;5export var _tls_start: ?*anyopaque linksection(".tls") = null;
6export var _tls_end: u8 linksection(".tls$ZZZ") = 0;6export var _tls_end: ?*anyopaque linksection(".tls$ZZZ") = null;
7export var __xl_a: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLA") = null;7export var __xl_a: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLA") = null;
8export var __xl_z: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLZ") = null;8export var __xl_z: std.os.windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLZ") = null;
99
...@@ -31,8 +31,8 @@ comptime {...@@ -31,8 +31,8 @@ comptime {
31//};31//};
32// This is the workaround because we can't do @intFromPtr at comptime like that.32// This is the workaround because we can't do @intFromPtr at comptime like that.
33pub const IMAGE_TLS_DIRECTORY = extern struct {33pub const IMAGE_TLS_DIRECTORY = extern struct {
34 StartAddressOfRawData: *anyopaque,34 StartAddressOfRawData: *?*anyopaque,
35 EndAddressOfRawData: *anyopaque,35 EndAddressOfRawData: *?*anyopaque,
36 AddressOfIndex: *anyopaque,36 AddressOfIndex: *anyopaque,
37 AddressOfCallBacks: *anyopaque,37 AddressOfCallBacks: *anyopaque,
38 SizeOfZeroFill: u32,38 SizeOfZeroFill: u32,