core/ptr: Add simulate_realloc() by mrkajetanp · Pull Request #130886 · rust-lang/rust (original) (raw)
Add a simulate_realloc()
helper function to core/ptr to simulate
reallocating memory from a pointer to some arbitrary address.
The function is intended to be used with architecture features such as
AArch64 Top-Byte Ignore where two different 64-bit addresses can point
to the same chunk of memory due to some bits being ignored.
To make the function accurately simulate an allocator, its return value
needs to be annotated with noalias
in LLVM the same way as it is done
by actual allocator functions. To make that possible, add a new rustc
built-in attribute rustc_simulate_allocator
that does the annotating.
Accompanying implementation for RFC 3700, currently posted on Rust Internals.
r? @RalfJung