From e2466821add3873d1feb0cc28f3b31e7cf1629fd Mon Sep 17 00:00:00 2001 From: Autumn Date: Thu, 31 Mar 2022 16:13:19 -0700 Subject: [PATCH] add notes about alignment-altering reallocs to Allocator docs --- library/core/src/alloc/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index 1f1033b0437f8..242725b96bd90 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -173,6 +173,8 @@ pub unsafe trait Allocator { /// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.). /// * `new_layout.size()` must be greater than or equal to `old_layout.size()`. /// + /// Note that `new_layout.align()` need not be the same as `old_layout.align()`. + /// /// [*currently allocated*]: #currently-allocated-memory /// [*fit*]: #memory-fitting /// @@ -234,6 +236,8 @@ pub unsafe trait Allocator { /// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.). /// * `new_layout.size()` must be greater than or equal to `old_layout.size()`. /// + /// Note that `new_layout.align()` need not be the same as `old_layout.align()`. + /// /// [*currently allocated*]: #currently-allocated-memory /// [*fit*]: #memory-fitting /// @@ -296,6 +300,8 @@ pub unsafe trait Allocator { /// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.). /// * `new_layout.size()` must be smaller than or equal to `old_layout.size()`. /// + /// Note that `new_layout.align()` need not be the same as `old_layout.align()`. + /// /// [*currently allocated*]: #currently-allocated-memory /// [*fit*]: #memory-fitting ///