about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-01 14:35:38 +0000
committerbors <bors@rust-lang.org>2024-04-01 14:35:38 +0000
commitc518e5aeecd3421a8ed5acb96946badb217dc64f (patch)
tree74c0ea2c77e2bcf11724a006784726eb6fd09abc /compiler/rustc_codegen_llvm/src
parent6bb6b816bfcf9e26fac5175e3e907dcefe5ecdbc (diff)
parentd7b55e4c90b6723d95b7cb8c152660b2ef7afcba (diff)
downloadrust-c518e5aeecd3421a8ed5acb96946badb217dc64f.tar.gz
rust-c518e5aeecd3421a8ed5acb96946badb217dc64f.zip
Auto merge of #123265 - joboet:guardians_of_the_unix, r=ChrisDenton
Refactor stack overflow handling

Currently, every platform must implement a `Guard` that protects a thread from stack overflow. However, UNIX is the only platform that actually does so. Windows has a different mechanism for detecting stack overflow, while the other platforms don't detect it at all. Also, the UNIX stack overflow handling is split between `sys::pal::unix::stack_overflow`, which implements the signal handler, and `sys::pal::unix::thread`, which detects/installs guard pages.

This PR cleans this by getting rid of `Guard` and unifying UNIX stack overflow handling inside `stack_overflow` (commit 1). Therefore we can get rid of `sys_common::thread_info`, which stores `Guard` and the current `Thread` handle and move the `thread::current` TLS variable into `thread` (commit 2).

The second commit is not strictly speaking necessary. To keep the implementation clean, I've included it here, but if it causes too much noise, I can split it out without any trouble.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions