about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2018-11-12 09:00:39 +0100
committerRalf Jung <post@ralfj.de>2018-11-12 09:01:57 +0100
commit075983c70ba20f31fc1279dacae6d6fcb8bc9cad (patch)
tree88b86bc44baa77c078878ae2a650eed69052c36e /src/liballoc
parentd1d79ae3ad36e82e2be33bea108d6a4e98ddce0b (diff)
downloadrust-075983c70ba20f31fc1279dacae6d6fcb8bc9cad.tar.gz
rust-075983c70ba20f31fc1279dacae6d6fcb8bc9cad.zip
global allocators: add a few comments
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/alloc.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/alloc.rs b/src/liballoc/alloc.rs
index 3bd0c243b39..1a8a081e16f 100644
--- a/src/liballoc/alloc.rs
+++ b/src/liballoc/alloc.rs
@@ -21,6 +21,10 @@ use core::usize;
 pub use core::alloc::*;
 
 extern "Rust" {
+    // These are the magic symbols to call the global allocator.  rustc generates
+    // them from the `#[global_allocator]` attribute if there is one, or uses the
+    // default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
+    // otherwise.
     #[allocator]
     #[rustc_allocator_nounwind]
     fn __rust_alloc(size: usize, align: usize) -> *mut u8;