about summary refs log tree commit diff
path: root/library/std/src/alloc.rs
diff options
context:
space:
mode:
authorChristopher Durham <cad97@cad97.com>2022-09-03 16:47:12 -0500
committerGitHub <noreply@github.com>2022-09-03 16:47:12 -0500
commit69721defc21e9704c39aec65dea9e2be4377cb1b (patch)
treec4f0e67489436a97653e8d08e6b01aa3c8073816 /library/std/src/alloc.rs
parentdec689432fac6720b2f18101ac28a21add98b1b8 (diff)
downloadrust-69721defc21e9704c39aec65dea9e2be4377cb1b.tar.gz
rust-69721defc21e9704c39aec65dea9e2be4377cb1b.zip
Forbid mixing `System` with sytem allocator calls
Diffstat (limited to 'library/std/src/alloc.rs')
-rw-r--r--library/std/src/alloc.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/std/src/alloc.rs b/library/std/src/alloc.rs
index a05e0db3af7..61c1ff578b2 100644
--- a/library/std/src/alloc.rs
+++ b/library/std/src/alloc.rs
@@ -68,7 +68,10 @@ pub use alloc_crate::alloc::*;
 /// The default memory allocator provided by the operating system.
 ///
 /// This is based on `malloc` on Unix platforms and `HeapAlloc` on Windows,
-/// plus related functions.
+/// plus related functions. However, it is not valid to mix use of the backing
+/// system allocator with `System`, as this implementation may include extra
+/// work, such as to serve alignment requests greater than the alignment
+/// provided directly by the backing system allocator.
 ///
 /// This type implements the `GlobalAlloc` trait and Rust programs by default
 /// work as if they had this definition: