You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/src/glossary.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,17 +57,24 @@ Abstract Rust Machine is intended to operate according to the definition here.
57
57
58
58
#### (Pointer) Provenance
59
59
60
-
The *provenance* of a pointer can be used, in the Rust Abstract Machine, to distinguish pointers that point to the same memory address (i.e., pointers that, when cast to `usize`, will compare equal).
60
+
The *provenance* of a pointer is used, in the Rust Abstract Machine, to distinguish pointers that point to the same memory address (i.e., pointers that, when cast to `usize`, will compare equal).
61
61
62
62
For example, we have to distinguish pointers to the same location if they originated from different allocations.
63
-
A pointer "remembers" the original allocation to which it pointed.
64
-
This is necessary to make it impossible for pointer arithmetic to cross allocation boundaries:
63
+
After all, cross-allocation pointer arithmetic does not lead to usable pointers, so the Rust Abstract Machine *somehow* has to remember the original allocation to which a pointer pointed.
64
+
It uses provenance to achieve this:
65
65
66
66
```rust
67
+
// Let's assume the two allocations here have base addresses 0x100 and 0x200.
68
+
// We write pointer provenance as `@N` where `N` is some kind of ID uniquely
0 commit comments