Skip to content

Commit

Permalink
kernel: add comments to StatHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Dec 14, 2022
1 parent 263f6e0 commit 436bcc4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,24 @@
**
*T StatHeader
**
** Header for any statement or expression encoded in a function body.
*/
typedef struct {
// `visited` starts out as 0 and is set to 1 if the statement or
// expression has ever been executed while profiling is turned on
unsigned int visited : 1;

// `line` records the line number in the source file in which the
// statement or expression started
unsigned int line : 31;

// `size` is the length in bytes of the statement or expression in
// bytes; the actual encoding rounds this up to a multiple of
// `sizeof(Stat)`
unsigned int size : 24;

// the type of the expression or statement, see `enum STAT_TNUM`
// and `enum EXPR_TNUM`.
unsigned int type : 8;
} StatHeader;

Expand Down

0 comments on commit 436bcc4

Please sign in to comment.