From d6f359bb6043ff2e74a44ab0921d98d30c28b056 Mon Sep 17 00:00:00 2001 From: asquared31415 <34665709+asquared31415@users.noreply.github.com> Date: Mon, 29 Jun 2026 21:58:21 +0000 Subject: [PATCH] update 'allocation' docs with memory atomicity requirement --- library/core/src/ptr/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 48e1e206a313e..ff3f3755e9c33 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -122,6 +122,11 @@ //! Allocations must behave like "normal" memory: in particular, reads must not have //! side-effects, and writes must become visible to other threads using the usual synchronization //! primitives. +//! Allocations must support all atomic operations that are available for the target (as +//! determined by the `target_has_atomic*` set of cfg flags). +//! The precise instructions used for atomic operations are generally not guaranteed, so portable +//! software should place all Rust allocations in memory regions that support all atomic +//! instructions. //! //! For any allocation with `base` address, `size`, and a set of //! `addresses`, the following are guaranteed: