pub unsafe auto trait PsramSafe { }Expand description
Marker for types safe to store in PSRAM: nothing holding an inline atomic.
Atomic read-modify-write instructions misbehave against PSRAM-backed
addresses on ESP32 / ESP32-S3, so the checked allocators psram_box /
psram_vec only accept T: PsramSafe. Like Send / Sync this is an
auto trait: a struct is PsramSafe iff every field is, so a type that
embeds an Atomic* (directly or transitively — e.g. via Arc, many lock
types) is rejected at compile time.
A pointer or reference to an atomic living elsewhere is fine — the atomic
itself is not in PSRAM — so &T, &mut T, *const T and *mut T are
always PsramSafe.
§Safety
Only implement (or negative-impl) this to reflect the atomic-in-PSRAM hazard; the checked allocators rely on it to keep atomics out of PSRAM.