checkSizes
function · lua · boundary
- Address
0x6f7370· 107 bytes, up to0x6f73da- Meaning
- Halves the string table and the work buffer when they are mostly unused
- Confidence
- verified, proof one
- Finding
- lua/runtime#sweeping-and-finalizers
Finding: Sweeping and finalizers in lua: calls, states and the collector
A collection frees what is unmarked. luaC_sweep sweeps the main list and every string bucket
(sweepstrings) with sweeplist, which frees an unmarked object through freeobj by its tag and
clears the mark of a survivor. luaC_callGCTM calls the __gc metamethods of the userdata set aside
for finalizing, one at a time through do1gcTM, with hooks off. checkSizes halves an oversized
string table and work buffer, and then sets the next threshold in a function the client added.
luaC_link puts a new object on the main list with a tag and clear marks.
| function | name | decided by |
|---|---|---|
0x6f7080 | luaC_callGCTM | hooks off (0x6f7099), each userdata moved to the main list (0x6f70aa), do1gcTM (0x6f70da) |
0x6f7120 | do1gcTM | no-tag-method flag test (0x6f712a), luaT_gettm (0x6f7146), luaD_call (0x6f71bd) |
0x6f71d0 | luaC_sweep | limit 0x100 for the free-all argument (0x6f71da), sweeplist (0x6f71e8), sweepstrings (0x6f71f1), sweeplist (0x6f71ff) |
0x6f7210 | sweeplist | mark byte against the limit (0x6f7229), low mark bit of a survivor cleared (0x6f722e), freeobj (0x6f723e) |
0x6f7260 | freeobj | tag test (0x6f7267): proto 0x6fa050 (0x6f7273), closure 0x6fa110 (0x6f7278), table 0x6fa690 (0x6f7291), thread 0x6f6c90 (0x6f7296) |
0x6f72f0 | sweepstrings | sweeplist per bucket (0x6f7317), string count lowered by the freed number (0x6f731c) |
0x6f7370 | checkSizes | string count under a quarter and size over 64 (0x6f738c), luaS_resize (0x6f739c), buffer realloc in lgc.c (0x6f73c1), tail jmp to the threshold update (0x6f73d6) |
0x6f7b20 | luaC_link | old head stored in the object (0x6f7b29), object stored in [G+0x10] (0x6f7b31), mark 0 (0x6f7b34), tag from the argument (0x6f7b38) |
The derivation is in the doc.
Callers 1
Callees 3
- luaS_resize lua
- SetGcThreshold lua
- luaM_irealloc lua
Calls and jumps by a bare address, from tables/calls.tsv.