about summary refs log tree commit diff
path: root/library/std/src/sys/wasm/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-25 04:45:39 +0000
committerbors <bors@rust-lang.org>2021-04-25 04:45:39 +0000
commit5da10c01214a3d3ebec65b8ba6effada92a0673f (patch)
tree94bbe380b059b6f77025a1e7c8d290f62390998e /library/std/src/sys/wasm/mod.rs
parentf7c468fe9a1448b1f6ceee6a4c831fe6122a54f0 (diff)
parent7171fec13f3a3091f702a8e55f495ad1563dc4cd (diff)
downloadrust-5da10c01214a3d3ebec65b8ba6effada92a0673f.tar.gz
rust-5da10c01214a3d3ebec65b8ba6effada92a0673f.zip
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/wasm/mod.rs')
-rw-r--r--library/std/src/sys/wasm/mod.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/library/std/src/sys/wasm/mod.rs b/library/std/src/sys/wasm/mod.rs
index 82683c0f624..8705910c73a 100644
--- a/library/std/src/sys/wasm/mod.rs
+++ b/library/std/src/sys/wasm/mod.rs
@@ -35,8 +35,6 @@ pub mod path;
 pub mod pipe;
 #[path = "../unsupported/process.rs"]
 pub mod process;
-#[path = "../unsupported/stack_overflow.rs"]
-pub mod stack_overflow;
 #[path = "../unsupported/stdio.rs"]
 pub mod stdio;
 pub mod thread;