Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#68381 - mjp41:master, r=Dylan-DPC
Added minor clarification to specification of GlobalAlloc::realloc. The specification of `realloc` is slightly unclear: ``` /// * `layout` must be the same layout that was used /// to allocate that block of memory, ``` https://github.com/rust-lang/rust/blob/master/src/libcore/alloc.rs#L541-L542 In the case of an `alloc` or `alloc_zeroed` this is fairly evidently the `layout` parameter passed into the original call. In the case of a `realloc`, this I assume is `layout` modified to contain `new_size`. However, I could not find this case specified in the documentation. Thus technically in a sequence of calls to `realloc`, it would be valid to provide the second call to `realloc` the same `layout` as the first call to `realloc`, which is almost certainly not going to be handled correctly. This PR attempts to clarify the specification.
- Loading branch information