about summary refs log tree commit diff
path: root/library/core/src/alloc
diff options
context:
space:
mode:
authorAutumn <autumn@cyfox.net>2022-03-31 16:13:19 -0700
committerAutumn <autumn@cyfox.net>2022-03-31 16:13:19 -0700
commite2466821add3873d1feb0cc28f3b31e7cf1629fd (patch)
tree054a45900a378621dc828dfd9340ac1fcaa5f471 /library/core/src/alloc
parent0677edc86e342f333d4828b0ee1ef395a4e70fe5 (diff)
downloadrust-e2466821add3873d1feb0cc28f3b31e7cf1629fd.tar.gz
rust-e2466821add3873d1feb0cc28f3b31e7cf1629fd.zip
add notes about alignment-altering reallocs to Allocator docs
Diffstat (limited to 'library/core/src/alloc')
-rw-r--r--library/core/src/alloc/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs
index 1f1033b0437..242725b96bd 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
     ///