-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/ptr: Add simulate_realloc() #130886
base: master
Are you sure you want to change the base?
core/ptr: Add simulate_realloc() #130886
Conversation
This comment has been minimized.
This comment has been minimized.
This is just a reference PR for the RFC and the implementation is aarch64-specific hence the test failures. The question I hope the RFC process answers is whether the best approach would be to have a generic method like this with cfgs to choose between variants for different architectures hidden inside, or whether it should just be completely architecture-specific and put away in |
I'm afraid I don't have the capacity to shepherd this. Anyway it's blocked on the RFC. r? libs |
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.
c4c2b4e
to
3315105
Compare
☔ The latest upstream changes (presumably #135370) made this pull request unmergeable. Please resolve the merge conflicts. |
Add a
simulate_realloc()
helper function to core/ptr to simulatereallocating 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 doneby 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