benilla-re systems structs docs

traversestack

function · lua · orchestration

Address
0x6f7860 · 153 bytes, up to 0x6f78f8
Signature
void __fastcall (void *st, lua_State *L1)
Meaning
Marks a thread's globals and stack, clears the slots up to the highest call top and shrinks its vectors
Confidence
verified, proof one
Finding
lua/gc#traversing-a-thread

Finding: Traversing a thread in lua: marking

traversestack(st, L1) marks the thread's globals table, finds lim, the stack top or the highest top of a Lua call record (one without the C flag) above it, marks every collectable unmarked slot from the stack's base below the top, sets every slot from the top up to lim to nil with the current context word, and calls checkstacksizes(L1, lim). That halves the call records, luaD_reallocCI(L1, size_ci / 2), when four times those in use is below size_ci and size_ci is above 16; then the stack, luaD_reallocstack(L1, stacksize / 2), when four times the slots below lim is below stacksize and stacksize is above 90. Each happens at most once a collection.

The derivation is in the doc.

Callers 2

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.