zig

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

commit c2fcdc21c27803e5cbb6dfcb6f61aa0905f6df38 (tree)
parent 8056a851517cd92590ddb9a4b76ce7b1f4aeb242
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Sat,  3 Aug 2024 19:55:44 +0200

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.

Diffstat:
Mlib/std/os/windows/tls.zig | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

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