Content-Length: 6395 | pFad | https://doc.rust-lang.org/std/pin/../ops/../net/../cmp/../ptr/fn.without_provenance_mut.html

without_provenance_mut in std::ptr - Rust

without_provenance_mut

Function without_provenance_mut 

1.84.0 (const: 1.84.0) ยท Source
pub const fn without_provenance_mut<T>(addr: usize) -> *mut T
Expand description

Creates a pointer with the given address and no provenance.

This is equivalent to ptr::null_mut().with_addr(addr).

Without provenance, this pointer is not associated with any actual allocation. Such a no-provenance pointer may be used for zero-sized memory accesses (if suitably aligned), but non-zero-sized memory accesses with a no-provenance pointer are UB. No-provenance pointers are little more than a usize address in disguise.

This is different from addr as *mut T, which creates a pointer that picks up a previously exposed provenance. See with_exposed_provenance_mut for more details on that operation.

This is a Strict Provenance API.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/pin/../ops/../net/../cmp/../ptr/fn.without_provenance_mut.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy