diff options
| author | bors <bors@rust-lang.org> | 2021-04-25 04:45:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-25 04:45:39 +0000 |
| commit | 5da10c01214a3d3ebec65b8ba6effada92a0673f (patch) | |
| tree | 94bbe380b059b6f77025a1e7c8d290f62390998e /library/std/src/sys/wasi | |
| parent | f7c468fe9a1448b1f6ceee6a4c831fe6122a54f0 (diff) | |
| parent | 7171fec13f3a3091f702a8e55f495ad1563dc4cd (diff) | |
Auto merge of #84115 - CDirkx:rt, r=m-ou-se
Rework `init` and `cleanup` This PR reworks the code in `std` that runs before and after `main` and centralizes this code respectively in the functions `init` and `cleanup` in both `sys_common` and `sys`. This makes is easy to see what code is executed during initialization and cleanup on each platform just by looking at e.g. `sys::windows::init`. Full list of changes: - new module `rt` in `sys_common` to contain `init` and `cleanup` and the runtime macros. - `at_exit` and the mechanism to register exit handlers has been completely removed. In practice this was only used for closing sockets on windows and flushing stdout, which have been moved to `cleanup`. - <s>On windows `alloc` and `net` initialization is now done in `init`, this saves a runtime check in every allocation and network use.</s>
Diffstat (limited to 'library/std/src/sys/wasi')
| -rw-r--r-- | library/std/src/sys/wasi/args.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/mod.rs | 2 |
2 files changed, 0 insertions, 6 deletions
diff --git a/library/std/src/sys/wasi/args.rs b/library/std/src/sys/wasi/args.rs index 3c3e66985b3..c42c310e3a2 100644 --- a/library/std/src/sys/wasi/args.rs +++ b/library/std/src/sys/wasi/args.rs @@ -5,10 +5,6 @@ use crate::fmt; use crate::os::wasi::ffi::OsStrExt; use crate::vec; -pub unsafe fn init(_argc: isize, _argv: *const *const u8) {} - -pub unsafe fn cleanup() {} - pub struct Args { iter: vec::IntoIter<OsString>, } diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs index b7b640b174f..2584d35b6ef 100644 --- a/library/std/src/sys/wasi/mod.rs +++ b/library/std/src/sys/wasi/mod.rs @@ -42,8 +42,6 @@ pub mod pipe; pub mod process; #[path = "../unsupported/rwlock.rs"] pub mod rwlock; -#[path = "../unsupported/stack_overflow.rs"] -pub mod stack_overflow; pub mod stdio; pub mod thread; #[path = "../unsupported/thread_local_dtor.rs"] |
