
Managing stack with Lua and C++
Sep 23, 2012 · The lua_pcall will remove the argument (s) and function from the stack. So it will pop N + 1 items from the stack, where N is the number of arguments to the Lua function as …
Newest 'lua' Questions - Stack Overflow
Dec 20, 2025 · Stack InternalImplement a knowledge platform layer to power your enterprise and AI tools. Stack Data LicensingGet access to top-class technical expertise with trusted & …
How Lua deal with the stack? - Stack Overflow
Aug 9, 2012 · Think of lua_State as containing the Lua stack, as well as indices delimiting the current visible part of the stack. When you invoke a Lua function, it may look like you have a …
From C, how can I print the contents of the Lua stack?
Nov 28, 2019 · Unfortunately not. I already have a stack trace when my program crashes, and I already know what line it is crashing. What I want is to be able to print the Lua values that are …
Lua C API: what's the difference between lua_gettop() and -1?
Mar 27, 2017 · lua_gettop() Returns the index of the top element in the stack. Because indices start at 1, this result is equal to the number of elements in the stack (and so 0 means an empty …
Using lua_checkstack? - Stack Overflow
Aug 5, 2020 · LUA_MINSTACK is defined as 20, so that usually you do not have to worry about stack space unless your code has loops pushing elements onto the stack. The only way you …
How to find how many items (values) are in lua stack
Mar 2, 2021 · I'm working with lua in C++ and I want to find how many "slots" (you can say) are being used in lua stack, and if possible, what is the size of lua stack?
Print stacktrace from C code with embedded lua - Stack Overflow
Sep 4, 2012 · The Lua runtime (lua.exe) will do that, but the Lua library will not do that on its own. If you want a call-stack with your Lua errors, then you need to generate one.
Get true stack trace of an error in lua pcall
Aug 21, 2017 · I was wondering if there was a way to get the stack trace of the pcall and not the current stack trace. I tried debug.stacktrace(err) but it didn't make a difference.
How to push a table onto the Lua stack
Nov 26, 2022 · Lua may use these hints to preallocate memory for the new table. This preallocation is useful for performance when you know in advance how many elements the …