Skip to content

Commit

Permalink
Merge pull request #456 from RalfJung/term-format
Browse files Browse the repository at this point in the history
more consistent formatting of special terms
  • Loading branch information
RalfJung committed Aug 31, 2023
2 parents 10c0899 + af4e074 commit 0cf4172
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reference/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
### Abstract Byte
[abstract byte]: #abstract-byte

The "byte" is the smallest unit of storage in Rust.
The *byte* is the smallest unit of storage in Rust.
Memory allocations are thought of as storing a list of bytes, and at the lowest level each load returns a list of bytes and each store takes a list of bytes and puts it into memory.
(The [representation relation] then defines how to convert between those lists of bytes and higher-level values such as mathematical integers or pointers.)

However, a "byte" in the Rust Abstract Machine is more complicated than just an integer in `0..256` -- think of it as there being some extra "shadow state" that is relevant for the Abstract Machine execution (in particular, for whether this execution has UB), but that disappears when compiling the program to assembly.
That's why we call it "abstract byte", to distinguish it from the physical machine byte in `0..256`.
However, a *byte* in the Rust Abstract Machine is more complicated than just an integer in `0..256` -- think of it as there being some extra "shadow state" that is relevant for the Abstract Machine execution (in particular, for whether this execution has UB), but that disappears when compiling the program to assembly.
That's why we call it *abstract byte*, to distinguish it from the physical machine byte in `0..256`.

The most obvious "shadow state" is tracking whether memory is initialized.
See [this blog post](https://www.ralfj.de/blog/2019/07/14/uninit.html) for details, but the gist of it is that bytes in memory are more like `Option<u8>` where `None` indicates that this byte is uninitialized.
Expand Down

0 comments on commit 0cf4172

Please sign in to comment.