Skip to content

Commit e246682

Browse files
committed
add notes about alignment-altering reallocs to Allocator docs
1 parent 0677edc commit e246682

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/src/alloc/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ pub unsafe trait Allocator {
173173
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
174174
/// * `new_layout.size()` must be greater than or equal to `old_layout.size()`.
175175
///
176+
/// Note that `new_layout.align()` need not be the same as `old_layout.align()`.
177+
///
176178
/// [*currently allocated*]: #currently-allocated-memory
177179
/// [*fit*]: #memory-fitting
178180
///
@@ -234,6 +236,8 @@ pub unsafe trait Allocator {
234236
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
235237
/// * `new_layout.size()` must be greater than or equal to `old_layout.size()`.
236238
///
239+
/// Note that `new_layout.align()` need not be the same as `old_layout.align()`.
240+
///
237241
/// [*currently allocated*]: #currently-allocated-memory
238242
/// [*fit*]: #memory-fitting
239243
///
@@ -296,6 +300,8 @@ pub unsafe trait Allocator {
296300
/// * `old_layout` must [*fit*] that block of memory (The `new_layout` argument need not fit it.).
297301
/// * `new_layout.size()` must be smaller than or equal to `old_layout.size()`.
298302
///
303+
/// Note that `new_layout.align()` need not be the same as `old_layout.align()`.
304+
///
299305
/// [*currently allocated*]: #currently-allocated-memory
300306
/// [*fit*]: #memory-fitting
301307
///

0 commit comments

Comments
 (0)