benilla-re systems structs docs

cleartablekeys

function · lua · primitive

Address
0x6f7970 · 84 bytes, up to 0x6f79c3
Signature
void __fastcall (void *list)
Meaning
Removes the nodes whose keys are unmarked from each table of a weak-keyed list
Confidence
verified, proof one
Finding
lua/gc#clearing-weak-keys
Test
lua::cleartablekeys_whole

Finding: Clearing weak keys in lua: marking

cleartablekeys(list) walks a list of tables through +0x18, each one's nodes from the last; a node whose key valismarked refuses is removed by removekey: its value made nil with the current context word, a collectable key's tag set to −1 (LUA_TNONE), the node kept. valismarked(o) first marks a string, so every string key of a weak-keyed table survives, its value nil or not; then it answers 1 for a tag below 4, else the mark bit. mark clears the values of the both-weak and value-weak lists, then, after the second propagation, the keys of the first both-weak list and of the key-weak list, the values of the value-weak list, and both of the second both-weak list.

The derivation is in the doc.

Callers 1

Callees 2

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