diff options
| author | Ralf Jung <post@ralfj.de> | 2018-11-12 09:00:39 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-11-12 09:01:57 +0100 |
| commit | 075983c70ba20f31fc1279dacae6d6fcb8bc9cad (patch) | |
| tree | 88b86bc44baa77c078878ae2a650eed69052c36e /src/libstd | |
| parent | d1d79ae3ad36e82e2be33bea108d6a4e98ddce0b (diff) | |
| download | rust-075983c70ba20f31fc1279dacae6d6fcb8bc9cad.tar.gz rust-075983c70ba20f31fc1279dacae6d6fcb8bc9cad.zip | |
global allocators: add a few comments
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/alloc.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/alloc.rs b/src/libstd/alloc.rs index 485b2ffe197..9c057396470 100644 --- a/src/libstd/alloc.rs +++ b/src/libstd/alloc.rs @@ -142,6 +142,7 @@ pub use alloc_crate::alloc::*; #[derive(Debug, Copy, Clone)] pub struct System; +// The Alloc impl just forwards to the GlobalAlloc impl, which is in `std::sys::*::alloc`. #[unstable(feature = "allocator_api", issue = "32838")] unsafe impl Alloc for System { #[inline] @@ -226,6 +227,10 @@ pub fn rust_oom(layout: Layout) -> ! { #[unstable(feature = "alloc_internals", issue = "0")] pub mod __default_lib_allocator { use super::{System, Layout, GlobalAlloc}; + // These magic symbol names are used as a fallback for implementing the + // `__rust_alloc` etc symbols (see `src/liballoc/alloc.rs) when there is + // no `#[global_allocator]` attribute. + // for symbol names src/librustc/middle/allocator.rs // for signatures src/librustc_allocator/lib.rs |
