File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ pub unsafe trait GlobalAlloc {
122
122
/// this allocator,
123
123
///
124
124
/// * `layout` must be the same layout that was used
125
- /// to allocate that block of memory,
125
+ /// to allocate that block of memory.
126
126
#[ stable( feature = "global_alloc" , since = "1.28.0" ) ]
127
127
unsafe fn dealloc ( & self , ptr : * mut u8 , layout : Layout ) ;
128
128
@@ -167,7 +167,10 @@ pub unsafe trait GlobalAlloc {
167
167
/// and should be considered unusable (unless of course it was
168
168
/// transferred back to the caller again via the return value of
169
169
/// this method). The new memory block is allocated with `layout`, but
170
- /// with the `size` updated to `new_size`.
170
+ /// with the `size` updated to `new_size`. This new layout should be
171
+ /// used when deallocating the new memory block with `dealloc`. The range
172
+ /// `0..min(layout.size(), new_size)` of the new memory block is
173
+ /// guaranteed to have the same values as the original block.
171
174
///
172
175
/// If this method returns null, then ownership of the memory
173
176
/// block has not been transferred to this allocator, and the
You can’t perform that action at this time.
0 commit comments