From 57bb4d118c2dd7a64b174e58e58a0eed4e723734 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 25 Aug 2026 14:44:43 +0200 Subject: [PATCH] explicitly state that allocations cannot grow to the left --- library/core/src/ptr/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 2bdb12485dd68..f349259582447 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -159,10 +159,10 @@ //! //! Allocations typically have a fixed size that cannot change. However, allocations created by //! directly invoking page table operations of the operating system, e.g. via `mmap`, are allowed to -//! grow by adding more pages to them at the end. Unmapping parts of an allocation (i.e., shrinking -//! it or punching holes into it) is currently not supported. Allocations created via -//! "compiler-recognized" operations, such as `std::alloc` methods or `libc::malloc`, can never -//! change their size, even if they use `mmap` under the hood. +//! grow by adding more pages to them at the end. Adding more pages before the beginning, or +//! unmapping parts of an allocation (i.e., shrinking it or punching holes into it), is currently +//! not supported. Allocations created via "compiler-recognized" operations, such as `std::alloc` +//! methods or `libc::malloc`, can never change their size, even if they use `mmap` under the hood. //! //! [`null()`]: null //!