benilla-re systems structs docs

lua_remove

function · lua · boundary

Address
0x6f30d0 · 193 bytes, up to 0x6f3190
Meaning
Removes the value at an index and shifts the values above it down one slot
Confidence
verified, proof two
Finding
lua/api#stack-moves

Finding: Stack moves in lua: the C API

Seven functions move values on the stack. luaA_pushobject copies a value to the top and makes room first, lua_xmove moves the top n values of one state onto another, lua_settop sets the top (filling with nil), lua_remove and lua_insert shift the values above an index down or up one slot, lua_replace pops the top into an index and lua_pushvalue pushes a copy of an index. Each resolves its index by the same inlined walk: positive from the base, negative from the top, -10000 the registry, -10001 the globals, below that an upvalue of the running C function.

functionnamedecided by
0x6f2ec0luaA_pushobjectcopies 16 bytes to [L+8] (0x6f2ecc), calls luaD_growstack at 0x6f2f19, adds 16 at 0x6f2f24
0x6f2f80lua_xmovelowers the first top by n*16 (0x6f2f9c), copies each to [to+8] and raises it (0x6f3007); ret 4
0x6f3080lua_settopnil tag 0 stores at 0x6f309a, top from base at 0x6f30bb, negative index adds (idx+1)*16 at 0x6f30c5
0x6f30d0lua_removecopy loop from idx+16 to idx (0x6f3140), top lowered by 16 at 0x6f318b
0x6f31a0lua_insertcopy loop upward from the top (0x6f3218), top value stored at the index (0x6f326b)
0x6f32b0lua_replacecopies [top-16] to the index slot, then add [ecx+8],-16 (0x6f3347)
0x6f3350lua_pushvaluecopies the index slot to [L+8], then add [ecx+8],16 (0x6f33eb)

The derivation is in the doc.

Callers 5

Callees 0

None by a direct call or jump.

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