diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2016-01-09 18:20:33 +0000 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2016-01-12 01:55:45 +0000 |
| commit | 757f57bb1eef755474cbb71945ed6370890dd936 (patch) | |
| tree | 0ea5fcaf8b512548c82b027c387ce820bd593712 /src/liballoc/lib.rs | |
| parent | d70ab2bdf16c22b9f3ff0230089b44855e3f1593 (diff) | |
| download | rust-757f57bb1eef755474cbb71945ed6370890dd936.tar.gz rust-757f57bb1eef755474cbb71945ed6370890dd936.zip | |
Add set_oom_handler and use it print a message when out of memory
Diffstat (limited to 'src/liballoc/lib.rs')
| -rw-r--r-- | src/liballoc/lib.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 93b84cdedd4..dd4bf5174ee 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -92,6 +92,7 @@ #![feature(unsize)] #![feature(drop_in_place)] #![feature(fn_traits)] +#![feature(const_fn)] #![feature(needs_allocator)] @@ -127,15 +128,6 @@ mod boxed_test; pub mod arc; pub mod rc; pub mod raw_vec; +pub mod oom; -/// Common out-of-memory routine -#[cold] -#[inline(never)] -#[unstable(feature = "oom", reason = "not a scrutinized interface", - issue = "27700")] -pub fn oom() -> ! { - // FIXME(#14674): This really needs to do something other than just abort - // here, but any printing done must be *guaranteed* to not - // allocate. - unsafe { core::intrinsics::abort() } -} +pub use oom::oom; |
