File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -203,18 +203,19 @@ pub unsafe trait GlobalAlloc {
203203 ptr
204204 }
205205
206- /// Shrink or grow a block of memory to the given `new_size`.
206+ /// Shrink or grow a block of memory to the given `new_size` in bytes .
207207 /// The block is described by the given `ptr` pointer and `layout`.
208208 ///
209209 /// If this returns a non-null pointer, then ownership of the memory block
210210 /// referenced by `ptr` has been transferred to this allocator.
211211 /// Any access to the old `ptr` is Undefined Behavior, even if the
212212 /// allocation remained in-place. The newly returned pointer is the only valid pointer
213213 /// for accessing this memory now.
214+ ///
214215 /// The new memory block is allocated with `layout`,
215- /// but with the `size` updated to `new_size`. This new layout must be
216- /// used when deallocating the new memory block with `dealloc`. The range
217- /// `0..min(layout.size(), new_size)` of the new memory block is
216+ /// but with the `size` updated to `new_size` in bytes.
217+ /// This new layout must be used when deallocating the new memory block with `dealloc`.
218+ /// The range `0..min(layout.size(), new_size)` of the new memory block is
218219 /// guaranteed to have the same values as the original block.
219220 ///
220221 /// If this method returns null, then ownership of the memory
You can’t perform that action at this time.
0 commit comments