aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/alloc.rs
diff options
context:
space:
mode:
authorlinouxis9 <[email protected]>2018-05-07 15:31:54 +0200
committerlinouxis9 <[email protected]>2018-05-07 15:35:20 +0200
commit4901431b02227416b08e5fbc9a7ac3f5ac2f44a7 (patch)
tree7fb75cf805b8f0e9b7f169af37c9d2aa0c4aded6 /ctr-std/src/alloc.rs
parentMerge pull request #66 from FenrirWolf/swkbd (diff)
downloadctru-rs-4901431b02227416b08e5fbc9a7ac3f5ac2f44a7.tar.xz
ctru-rs-4901431b02227416b08e5fbc9a7ac3f5ac2f44a7.zip
Update for latest nightly 2018-05-06
Diffstat (limited to 'ctr-std/src/alloc.rs')
-rw-r--r--ctr-std/src/alloc.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/ctr-std/src/alloc.rs b/ctr-std/src/alloc.rs
index ff578ec..a857840 100644
--- a/ctr-std/src/alloc.rs
+++ b/ctr-std/src/alloc.rs
@@ -13,10 +13,18 @@
#![unstable(issue = "32838", feature = "allocator_api")]
#[doc(inline)] #[allow(deprecated)] pub use alloc_crate::alloc::Heap;
-#[doc(inline)] pub use alloc_crate::alloc::Global;
+#[doc(inline)] pub use alloc_crate::alloc::{Global, oom};
#[doc(inline)] pub use alloc_system::System;
#[doc(inline)] pub use core::alloc::*;
+#[cfg(not(stage0))]
+#[cfg(not(test))]
+#[doc(hidden)]
+#[lang = "oom"]
+pub extern fn rust_oom() -> ! {
+ rtabort!("memory allocation failed");
+}
+
#[cfg(not(test))]
#[doc(hidden)]
#[allow(unused_attributes)]
@@ -35,10 +43,11 @@ pub mod __default_lib_allocator {
System.alloc(layout) as *mut u8
}
+ #[cfg(stage0)]
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern fn __rdl_oom() -> ! {
- System.oom()
+ super::oom()
}
#[no_mangle]