about summary refs log tree commit diff
path: root/src/liballoc/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-02 21:22:14 +0000
committerbors <bors@rust-lang.org>2014-11-02 21:22:14 +0000
commita294b35060e069007ee46e190a6f0a19fa3eaab8 (patch)
tree4201a43fec3a750a6fb28e1fa67beddf7a3b249c /src/liballoc/lib.rs
parent0c1268451b1f51fdaa31938707df8c56f08cfb31 (diff)
parentfea985a0b5008bc2f441866a80c0e3a16592eaab (diff)
downloadrust-a294b35060e069007ee46e190a6f0a19fa3eaab8.tar.gz
rust-a294b35060e069007ee46e190a6f0a19fa3eaab8.zip
auto merge of #18406 : thestinger/rust/oom, r=cmr
This makes the low-level allocation API suitable for use cases where
out-of-memory conditions need to be handled.

Closes #18292

[breaking-change]
Diffstat (limited to 'src/liballoc/lib.rs')
-rw-r--r--src/liballoc/lib.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index c721649ca9d..2ff151c1363 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -11,8 +11,7 @@
 //! # The Rust core allocation library
 //!
 //! This is the lowest level library through which allocation in Rust can be
-//! performed where the allocation is assumed to succeed. This library will
-//! abort the process when allocation fails.
+//! performed.
 //!
 //! This library, like libcore, is not intended for general usage, but rather as
 //! a building block of other libraries. The types and interfaces in this
@@ -95,8 +94,10 @@ pub mod boxed;
 pub mod arc;
 pub mod rc;
 
-/// Common OOM routine used by liballoc
-fn oom() -> ! {
+/// Common out-of-memory routine
+#[cold]
+#[inline(never)]
+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.