about summary refs log tree commit diff
path: root/library/std/src/rt.rs
AgeCommit message (Collapse)AuthorLines
2022-12-30Replace libstd, libcore, liballoc in line comments.jonathanCogan-3/+3
2022-10-20Change process spawning to inherit the parent's signal mask by defaultRain-1/+1
Previously, the signal mask is always reset when a child process is started. This breaks tools like `nohup` which expect `SIGHUP` to be blocked. With this change, the default behavior changes to inherit the signal mask. This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.
2022-09-26remove cfg(bootstrap)Pietro Albini-4/+1
2022-09-01unix_sigpipe: Make `sigpipe` param docs long-formMartin Nordholts-2/+19
2022-08-31unix_sigpipe: Add docs for `init()` `sigpipe` paramMartin Nordholts-0/+2
2022-08-28Support `#[unix_sigpipe = "inherit|sig_dfl|sig_ign"]` on `fn main()`Martin Nordholts-3/+9
This makes it possible to instruct libstd to never touch the signal handler for `SIGPIPE`, which makes programs pipeable by default (e.g. with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe` errors.
2022-01-28Change Termination::report return type to ExitCodeJane Lusby-1/+1
2021-10-31Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplettMatthias Krüger-2/+1
Restructure std::rt (part 2) A couple more cleanups on top of https://github.com/rust-lang/rust/pull/89011 Blocked on #89011
2021-10-19Deduplicate panic_fmtGary Guo-2/+2
std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
2021-10-03Use rtabort! instead of rtprintpanic! + abort_internalbjorn3-2/+1
2021-09-29Auto merge of #89011 - bjorn3:restructure_rt, r=dtolnaybors-3/+85
Restructure std::rt These changes should reduce binary size slightly while at the same slightly improving performance of startup, thread spawning and `std::thread::current()`. I haven't verified if the compiler is able to optimize some of these cases already, but at least for some others the compiler is unable to do these optimizations as they slightly change behavior in cases where program startup would crash anyway by omitting a backtrace and panic location. I can remove 6f6bb16 if preferred.
2021-09-18Auto merge of #88988 - Mark-Simulacrum:avoid-into-ok, r=nagisabors-3/+3
Avoid codegen for Result::into_ok in lang_start This extra codegen seems to be the cause for the regressions in max-rss on #86034. While LLVM will certainly optimize the dead code away, avoiding it's generation in the first place seems good, particularly when it is so simple. #86034 produced this [diff](https://gist.github.com/Mark-Simulacrum/95c7599883093af3b960c35ffadf4dab#file-86034-diff) for a simple `fn main() {}`. With this PR, that diff [becomes limited to just a few extra IR instructions](https://gist.github.com/Mark-Simulacrum/95c7599883093af3b960c35ffadf4dab#file-88988-from-pre-diff) -- no extra functions. Note that these are pre-optimization; LLVM surely will eliminate this during optimization. However, that optimization can end up generating more work and bump memory usage, and this eliminates that.
2021-09-16Replace a couple of asserts with rtassert! in rt codebjorn3-32/+32
This replaces a couple of panic locations with hard aborts. The panics can't be catched by the user anyway in these locations.
2021-09-16Remove an allocation from rt::initbjorn3-1/+3
Previously the thread name would first be heap allocated and then re-allocated to add a nul terminator. Now it will be heap allocated only once with nul terminator added form the start.
2021-09-16Merge sys_common::rt into rtbjorn3-3/+83
2021-09-15Avoid codegen for Result::into_ok in lang_startMark Rousskov-3/+3
Otherwise, we end up pulling in an extra module as part of codegen, and that costs us a sizeable amount of work (both in LLVM and outside).
2021-09-15Allow `panic!("{}", computed_str)` in const fn.Gary Guo-0/+1
2021-06-19Change entry point to 🛡️ against 💥 💥-payloadsSimonas Kazlauskas-11/+26
Guard against panic payloads panicking within entrypoints, where it is UB to do so. Note that there are a number of implementation approaches to consider. Some simpler, some more complicated. This particular solution is nice in that it also guards against accidental implementation issues in various pieces of runtime code, something we cannot prevent statically right now. Fixes #86030
2021-04-22Remove `Once` from `init`Christiaan Dirkx-1/+4
2021-04-22Rework `at_exit` to `cleanup`Christiaan Dirkx-24/+4
2020-08-07Prevent `__rust_begin_short_backtrace` frames from being tail-call optimised ↵Alan Egerton-4/+6
away
2020-07-27mv std libs to library/mark-0/+68