From bd9428a46b7290b8f87d830655b473099207ae0d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 12 Jul 2017 20:39:02 -0600 Subject: [PATCH 1/2] Update mod.rs --- src/libstd/sys/redox/mod.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/libstd/sys/redox/mod.rs b/src/libstd/sys/redox/mod.rs index 31c40ea58b1de..bd5b40de9a071 100644 --- a/src/libstd/sys/redox/mod.rs +++ b/src/libstd/sys/redox/mod.rs @@ -40,23 +40,7 @@ pub mod time; #[cfg(not(test))] pub fn init() { - use alloc::oom; - - oom::set_oom_handler(oom_handler); - - // A nicer handler for out-of-memory situations than the default one. This - // one prints a message to stderr before aborting. It is critical that this - // code does not allocate any memory since we are in an OOM situation. Any - // errors are ignored while printing since there's nothing we can do about - // them and we are about to exit anyways. - fn oom_handler() -> ! { - use intrinsics; - let msg = "fatal runtime error: out of memory\n"; - unsafe { - let _ = syscall::write(2, msg.as_bytes()); - intrinsics::abort(); - } - } + } pub fn decode_error_kind(errno: i32) -> ErrorKind { From 21f2ace8cfaa6c6cd137cfa3b11222f4a06a0b87 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 12 Jul 2017 20:48:04 -0600 Subject: [PATCH 2/2] Update mod.rs --- src/libstd/sys/redox/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libstd/sys/redox/mod.rs b/src/libstd/sys/redox/mod.rs index bd5b40de9a071..7c728ebb1af2e 100644 --- a/src/libstd/sys/redox/mod.rs +++ b/src/libstd/sys/redox/mod.rs @@ -39,9 +39,7 @@ pub mod thread_local; pub mod time; #[cfg(not(test))] -pub fn init() { - -} +pub fn init() {} pub fn decode_error_kind(errno: i32) -> ErrorKind { match errno {