benilla-re systems structs docs

s_schedulerThreads

global · core

Address
0x883ecc · 16 bytes, up to 0x883edb
Type
uint32_t[4]
Meaning
Holds the array of extra loop threads: capacity, count, storage, quantum
Confidence
verified, proof one
Finding
core/scheduler#growable-arrays

Finding: Growable arrays in core: scheduler

Growable arrays are four dwords: capacity, count, storage and quantum. A heap array adds a fifth, the offset from an element pointer to its heap node. Capacity rounds up to a multiple of the quantum: 64 for sizes of 64 and above, stored at +0x0c, and below 64 the highest power of two not above the size, 1 for size 0, not stored. Growth reallocates, falling back to allocate, copy and free. 0x422720(index, zero) raises the count to index + 1, zeroing the new entries on request; 0x422850(n) sets the count to n and grows only when n exceeds both count and capacity; 0x422b50(add, round) raises the capacity for count + add and leaves the count.

The derivation is in the doc.