diff options
| author | Carl Ã…stholm <carl@astholm.se> | 2025-03-23 13:12:45 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-03-23 17:13:19 -0400 |
| commit | f45f9649e3fc2aa2b6a76476f2467f02ffc7d461 (patch) | |
| tree | 4d10ac814ef9d7d7e9f06fffac796217336bfbc5 /lib/std/math | |
| parent | 9f235a105b29c6f1c0c773f66c40e7ee655da559 (diff) | |
| download | zig-f45f9649e3fc2aa2b6a76476f2467f02ffc7d461.tar.gz zig-f45f9649e3fc2aa2b6a76476f2467f02ffc7d461.zip | |
Lower `@returnAddress` to a constant 0 in Emscripten release builds
Emscripten currently implements `emscripten_return_address()` by calling
out into JavaScript and parsing a stack trace, which introduces
significant overhead that we would prefer to avoid in release builds.
This is especially problematic for allocators because the generic parts
of `std.mem.Allocator` make frequent use of `@returnAddress`, even
though very few allocator implementations even observe the return
address, which makes allocators nigh unusable for performance-critical
applications like games if the compiler is unable to devirtualize the
allocator calls.
Diffstat (limited to 'lib/std/math')
0 files changed, 0 insertions, 0 deletions
