File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 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 {
122122 /// this allocator,
123123 ///
124124 /// * `layout` must be the same layout that was used
125- /// to allocate that block of memory,
125+ /// to allocate that block of memory.
126126 #[ stable( feature = "global_alloc" , since = "1.28.0" ) ]
127127 unsafe fn dealloc ( & self , ptr : * mut u8 , layout : Layout ) ;
128128
@@ -167,7 +167,10 @@ pub unsafe trait GlobalAlloc {
167167 /// and should be considered unusable (unless of course it was
168168 /// transferred back to the caller again via the return value of
169169 /// 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.
171174 ///
172175 /// If this method returns null, then ownership of the memory
173176 /// block has not been transferred to this allocator, and the
You can’t perform that action at this time.
0 commit comments