]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/alloc.rs
Rollup merge of #101014 - isikkema:fix-zmeta-stats-file-encoder-no-read-perms, r...
[rust.git] / library / std / src / alloc.rs
index d554ec590358fd6f37d7745fbb18ba8dfd794961..61c1ff578b2cad4ec3f8c46b09bd71ab80ef0d1b 100644 (file)
 /// 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:
 ///         if !ret.is_null() {
 ///             ALLOCATED.fetch_add(layout.size(), SeqCst);
 ///         }
-///         return ret
+///         ret
 ///     }
 ///
 ///     unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {