diff options
author | David Eichmann <EichmannD@gmail.com> | 2020-11-09 19:23:16 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-10 10:28:46 -0500 |
commit | 2e63a0fb1bdaecc7916a3cc35dcfd2b2ef37c328 (patch) | |
tree | 7f50294c605f29d2f18775e5066cfdf2c147c9c8 /includes/rts/storage/TSO.h | |
parent | fa344d33dba71f31f55269c5fc733daa3830073a (diff) | |
download | haskell-2e63a0fb1bdaecc7916a3cc35dcfd2b2ef37c328.tar.gz |
Add code comments for StgInfoTable and StgStack structs
Diffstat (limited to 'includes/rts/storage/TSO.h')
-rw-r--r-- | includes/rts/storage/TSO.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h index 33eebffc7c..61215d9f38 100644 --- a/includes/rts/storage/TSO.h +++ b/includes/rts/storage/TSO.h @@ -242,10 +242,22 @@ typedef struct StgTSO_ { typedef struct StgStack_ { StgHeader header; - StgWord32 stack_size; // stack size in *words* + + /* Size of the `stack` field in *words*. This is not affected by how much of + * the stack space is used, nor if more stack space is linked to by an + * UNDERFLOW_FRAME. + */ + StgWord32 stack_size; + StgWord8 dirty; // non-zero => dirty StgWord8 marking; // non-zero => someone is currently marking the stack - StgPtr sp; // current stack pointer + + /* Pointer to the "top" of the stack i.e. the most recently written address. + * The stack is filled downwards, so the "top" of the stack starts with `sp + * = stack + stack_size` and is decremented as the stack fills with data. + * See comment on "Invariants" below. + */ + StgPtr sp; StgWord stack[]; } StgStack; |