Skip to content
Snippets Groups Projects
Commit 2e63a0fb authored by davide's avatar davide Committed by Marge Bot
Browse files

Add code comments for StgInfoTable and StgStack structs

parent fa344d33
No related merge requests found
......@@ -63,6 +63,11 @@ typedef struct {
-------------------------------------------------------------------------- */
typedef struct {
// If TABLES_NEXT_TO_CODE is defined, then `info` is offset by
// `sizeof(StgInfoTable)` and so points to the `code` field of the
// StgInfoTable! You may want to use `get_itbl` to get the pointer to the
// start of the info table. See
// https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/storage/heap-objects#tables_next_to_code.
const StgInfoTable* info;
#if defined(PROFILING)
StgProfHeader prof;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment