3 ms·
Provenance In C and Rust, essentially mean that each object, lives in its own memory space, and you cant travel between them. You cant use a pointer to one obje
by quelsolaar 3y ago
Provenance In C and Rust, essentially mean that each object, lives in its own memory space, and you cant travel between them. You cant use a pointer to one object, add an offset and get a valid pointer to another object.
This is key to a lot of compiler optimizations. It is de facto in C compilers, and therefor in a lot of compiler infrastructure used by other languages. There is an attempt to make it more clearly defined in the C standard:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3005.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3005.pdf
- ralfj 3y agoIt's not just per-object. When you consider things like `restrict` pointers in C, and the aliasing model in Rust (e.g. Stacked Borrows), you have provenance distinctions even within a single allocated object.