Skip to content

Commit

Permalink
clarifying comments around the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 19, 2023
1 parent cf32449 commit 6b49148
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions spec/lang/machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ pub struct Machine<M: Memory> {
/// The program we are executing.
prog: Program,

/// The state of memory.
/// The contents of memory.
mem: AtomicMemory<M>,

/// The state of the integer-pointer cast subsystem.
intptrcast: IntPtrCast<M::Provenance>,

/// The Threads
/// The threads (in particular, their stacks).
threads: List<Thread<M>>,

/// The currently / most recently active thread.
Expand Down Expand Up @@ -87,10 +87,13 @@ This defines the internal representation of a thread of execution.

```rust
pub struct Thread<M: Memory> {
state: ThreadState,

/// The stack.
/// The stack. This is only the "control" part of the stack; the "data" part
/// lives in memory (and stack and memory are completely disjoint concepts
/// in the Abstract Machine).
stack: List<StackFrame<M>>,

/// Stores whether the thread is ready to run, blocked, or terminated.
state: ThreadState,
}

pub enum ThreadState {
Expand Down

0 comments on commit 6b49148

Please sign in to comment.