diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-13 04:46:30 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-19 11:45:06 -0400 |
| commit | 917640810e7f3e18daff9e75b5ecefe761a1896c (patch) | |
| tree | 579e627d695f898d411a3cb1fbc0578d1a763cc2 /lib/std/debug/SelfInfo.zig | |
| parent | 16d78bc0c024da307c7ab5f6b94622e6b4b37397 (diff) | |
| download | zig-917640810e7f3e18daff9e75b5ecefe761a1896c.tar.gz zig-917640810e7f3e18daff9e75b5ecefe761a1896c.zip | |
Target: pass and use locals by pointer instead of by value
This struct is larger than 256 bytes and code that copies it
consistently shows up in profiles of the compiler.
Diffstat (limited to 'lib/std/debug/SelfInfo.zig')
| -rw-r--r-- | lib/std/debug/SelfInfo.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig index 70f3075de7..a879309870 100644 --- a/lib/std/debug/SelfInfo.zig +++ b/lib/std/debug/SelfInfo.zig @@ -1795,10 +1795,10 @@ fn spRegNum(reg_context: Dwarf.abi.RegisterContext) u8 { const ip_reg_num = Dwarf.abi.ipRegNum(native_arch).?; /// Tells whether unwinding for the host is implemented. -pub const supports_unwinding = supportsUnwinding(builtin.target); +pub const supports_unwinding = supportsUnwinding(&builtin.target); comptime { - if (supports_unwinding) assert(Dwarf.abi.supportsUnwinding(builtin.target)); + if (supports_unwinding) assert(Dwarf.abi.supportsUnwinding(&builtin.target)); } /// Tells whether unwinding for this target is *implemented* here in the Zig @@ -1806,7 +1806,7 @@ comptime { /// /// See also `Dwarf.abi.supportsUnwinding` which tells whether Dwarf supports /// unwinding on that target *in theory*. -pub fn supportsUnwinding(target: std.Target) bool { +pub fn supportsUnwinding(target: *const std.Target) bool { return switch (target.cpu.arch) { .x86 => switch (target.os.tag) { .linux, .netbsd, .solaris, .illumos => true, |
