File tree 1 file changed +5
-4
lines changed
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 {
203
203
ptr
204
204
}
205
205
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 .
207
207
/// The block is described by the given `ptr` pointer and `layout`.
208
208
///
209
209
/// If this returns a non-null pointer, then ownership of the memory block
210
210
/// referenced by `ptr` has been transferred to this allocator.
211
211
/// Any access to the old `ptr` is Undefined Behavior, even if the
212
212
/// allocation remained in-place. The newly returned pointer is the only valid pointer
213
213
/// for accessing this memory now.
214
+ ///
214
215
/// 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
218
219
/// guaranteed to have the same values as the original block.
219
220
///
220
221
/// If this method returns null, then ownership of the memory
You can’t perform that action at this time.
0 commit comments