luaS_freeall
function · lua · boundary
- Address
0x6f9c30· 28 bytes, up to0x6f9c4b- Meaning
- Frees the string hash vector
- Confidence
- verified, proof two
- Finding
- lua/object#strings
Finding: Strings in lua: objects and tables
A string is interned: luaS_newlstr hashes a block (the length seeds h, then
h ^= (h<<5) + (h>>2) + byte for every step-th byte from the end, step = (len>>5) + 1), looks
in the bucket hash & (size-1) for equal length and bytes, and calls newlstr otherwise. newlstr
allocates len + 0x11 bytes, links it into the bucket and doubles the table through
luaS_resize when the count passes the size. luaS_newudata allocates a userdata block.
luaS_freeall frees the string table.
| function | name | decided by |
|---|---|---|
0x6f9c30 | luaS_freeall | passes lstring.c and the vector size <<2 to luaM_irealloc (0x6f9c46) |
0x6f9c50 | luaS_resize | allocates size*4 (0x6f9c76), moves each chain by hash & (new-1), frees the old vector (0x6f9ce5) |
0x6f9d00 | luaS_newlstr | step len>>5 (0x6f9d0f), h<<5 and h>>2 mixing (0x6f9d2a, 0x6f9d31), newlstr (0x6f9d76) |
0x6f9d90 | newlstr | allocates len+0x11 (0x6f9dae), grows at nuse > size below 0x3ffffffe (0x6f9e0f, 0x6f9e19) |
0x6f9e30 | luaS_newudata | allocates size+0x10 (0x6f9e45), tag 7, metatable [G+0x48], linked into [G+0x14] |
The derivation is in the doc.
Callers 1
- close_state lua
Callees 1
- luaM_irealloc lua
Calls and jumps by a bare address, from tables/calls.tsv.