Open RalfJung opened 6 years ago
I don't think all would be, necessarily—just those pointing to the high RAM area which is banked.
Sorry, I somehow understood that all memory is being switched on bank change. Yes, only references pointing to memory addresses that actually change from a bank switch are invalidated.
Is there any way to read or write from address 0 today with Rust? Since address 0 is valid on all ARM-Cortex-M microcontrollers I know of, I think this should be made possible. Optimizing access to 0 away should be disabled in general on theses targets IMO.
Inline assembly.
This recently came up in a discussion. To my knowledge, LLVM has a pretty hard-coded assumption that for address space 0, NULL is never inbounds (let alone dereferencable), so we cannot actually support such targets with the LLVM backend. But there may well be tricks I am not aware of.