From 075983c70ba20f31fc1279dacae6d6fcb8bc9cad Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 12 Nov 2018 09:00:39 +0100 Subject: global allocators: add a few comments --- src/liballoc/alloc.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/liballoc/alloc.rs') 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; -- cgit 1.4.1-3-g733a5