EvtContext
struct · core · 532 bytes
- Vtable
0x801364- Meaning
- Holds a scheduled context: its run state, due time, flags, handler lists, messages, held input and timers
- Confidence
- verified, proof one
- Finding
- core/loop#contexts
Finding: Contexts in core: the frame loop
A context is a 0x214-byte object: a lock at +0x10, run state +0x2c, a heap node +0x30
whose key +0x3c is the due time, the last tick time +0x40, flags +0x44, the idle time
+0x48 and +0x4c, a load cost +0x50 and +0x54, 29 handler lists from +0x5c, and the
message, input, timer and thread state after them. For the client's context the constructor
stores: run state 0, last tick = now, flags 2 (interactive), idle time 1 ms in both fields, cost
1000 in both, and gives it a handle in the context table.
The derivation is in the doc.
Fields 25
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0000 | 4 | void ** | __vfptr | Holds the vtable 0x801364 | verified, proof one | core/loop#start-and-stop |
0x0004 | 8 | void *[2] | m_tableLink | Holds the context's link in its context table bucket | verified, proof one | core/loop#contexts |
0x000c | 4 | uint32_t | m_handle | Holds the context's handle, its key in the context table | verified, proof one | core/loop#contexts |
0x0010 | 24 | uint8_t[24] | m_lock | Holds the critical section guarding the run state, messages and timers | verified, proof one | core/loop#one-tick |
0x0028 | 4 | uint32_t | m_reserved | Holds 0 from the constructor; the event library reads it nowhere | verified, proof one | core/scheduler#context-fields |
0x002c | 4 | uint32_t | m_runState | Holds 0 running, 1 closing, 2 torn down | verified, proof two | core/loop#start-and-stop |
0x0030 | 12 | void *[3] | m_heapNode | Holds the heap node: vtable 0x801368, owning heap and index | verified, proof two | core/loop#scheduler-heap |
0x003c | 4 | uint32_t | m_dueTime | Holds the clock time the context is next due, the heap key | verified, proof two | core/loop#next-due-time |
0x0040 | 4 | uint32_t | m_lastFrameTime | Holds the clock time of the last frame time or start dispatch | verified, proof two | core/loop#frame-time |
0x0044 | 4 | uint32_t | m_flags | Holds 1 started, 2 interactive, 4 after-frame pending | verified, proof two | core/loop#start-and-stop |
0x0048 | 4 | uint32_t | m_idleTime | Holds the idle time in milliseconds, at least 1 | verified, proof two | core/loop#next-due-time |
0x004c | 4 | uint32_t | m_idleTimeInitial | Holds the idle time as constructed; a difference from +0x48 overrides the timer wait | verified, proof two | core/loop#next-due-time |
0x0050 | 4 | uint32_t | m_cost | Holds the load the context adds to its slot: 1000 interactive, 1 otherwise | verified, proof two | core/loop#contexts |
0x0054 | 4 | uint32_t | m_costTarget | Holds the cost passed to the reschedule | verified, proof two | core/loop#contexts |
0x0058 | 4 | uint32_t | m_costChanged | Holds 1 when the cost moved by more than an eighth | verified, proof one | core/loop#next-due-time |
0x005c | 348 | uint32_t[87] | m_handlerLists | Holds the 29 handler list heads of 12 bytes, one per category | verified, proof two | core/events#handler-records |
0x01b8 | 12 | uint32_t[3] | m_messages | Holds the deferred message list head | verified, proof two | core/events#deferred-messages |
0x01c4 | 4 | uint32_t | m_heldButtons | Holds the held-button mask the dispatch keeps | verified, proof two | core/events#held-buttons |
0x01c8 | 12 | uint32_t[3] | m_heldKeys | Holds the held-key list head | verified, proof two | core/events#held-keys-and-repeats |
0x01d4 | 16 | uint32_t[4] | m_timerTable | Holds the array of timer records by id | verified, proof two | core/events#timers |
0x01e4 | 16 | uint32_t[4] | m_freeTimerIds | Holds the array of timer ids free for reuse | verified, proof two | core/events#timers |
0x01f4 | 20 | uint32_t[5] | m_timerHeap | Holds the heap of timers ordered by due time | verified, proof two | core/events#timers |
0x0208 | 4 | void * | m_threadProps | Holds the property array the calling thread carries while the context runs | verified, proof one | core/scheduler#context-fields |
0x020c | 4 | void * | m_nameObject | Holds the name object, null unless the constructor was told to build one | verified, proof one | core/scheduler#context-fields |
0x0210 | 4 | uint32_t | m_flagBit | Holds bit 1 of the constructor's third argument | verified, proof one | core/scheduler#context-fields |