Skip to content

Commit 9d4b462

Browse files
authored
Rollup merge of #43203 - jackpot51:patch-2, r=alexcrichton
Remove obsolete oom handler from sys::redox Alloc no longer has set_oom_handler.
2 parents a14b30c + 21f2ace commit 9d4b462

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/libstd/sys/redox/mod.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,7 @@ pub mod thread_local;
3939
pub mod time;
4040

4141
#[cfg(not(test))]
42-
pub fn init() {
43-
use alloc::oom;
44-
45-
oom::set_oom_handler(oom_handler);
46-
47-
// A nicer handler for out-of-memory situations than the default one. This
48-
// one prints a message to stderr before aborting. It is critical that this
49-
// code does not allocate any memory since we are in an OOM situation. Any
50-
// errors are ignored while printing since there's nothing we can do about
51-
// them and we are about to exit anyways.
52-
fn oom_handler() -> ! {
53-
use intrinsics;
54-
let msg = "fatal runtime error: out of memory\n";
55-
unsafe {
56-
let _ = syscall::write(2, msg.as_bytes());
57-
intrinsics::abort();
58-
}
59-
}
60-
}
42+
pub fn init() {}
6143

6244
pub fn decode_error_kind(errno: i32) -> ErrorKind {
6345
match errno {

0 commit comments

Comments
 (0)