]> git.lizzy.rs Git - rust.git/commitdiff
Update doc-comment for grow_zeroed
authorTim Diekmann <21277928+TimDiekmann@users.noreply.github.com>
Sat, 1 Aug 2020 19:51:50 +0000 (21:51 +0200)
committerGitHub <noreply@github.com>
Sat, 1 Aug 2020 19:51:50 +0000 (21:51 +0200)
library/core/src/alloc/mod.rs

index f5632b578aec8b9ac9b233722c6c266f757e2526..fc62bb453a299fd5089c3870b490362a513b0852 100644 (file)
@@ -226,9 +226,14 @@ unsafe fn grow(
     /// Behaves like `grow`, but also ensures that the new contents are set to zero before being
     /// returned.
     ///
-    /// The memory block will contain the following contents after a successful call to `grow`:
+    /// The memory block will contain the following contents after a successful call to 
+    /// `grow_zeroed`:
     ///   * Bytes `0..layout.size()` are preserved from the original allocation.
-    ///   * Bytes `layout.size()..new_size` are zeroed. `new_size` refers to
+    ///   * Bytes `layout.size()..old_size` will either be preserved or zeroed,
+    ///     depending on the allocator implementation. `old_size` refers to the size of
+    ///     the `MemoryBlock` prior to the `grow_zeroed` call, which may be larger than the size
+    ///     that was originally requested when it was allocated.
+    ///   * Bytes `old_size..new_size` are zeroed. `new_size` refers to
     ///     the size of the `MemoryBlock` returned by the `grow` call.
     ///
     /// # Safety