This commit is contained in:
romkazvo
2023-08-07 19:29:24 +08:00
commit 34d6c5d489
4832 changed files with 1389451 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#ifndef _STACKGUARD_H_
#define _STACKGUARD_H_
struct _StackGuard
{
_StackGuard(lua_State *p)
{
m_pLS=p;
m_nTop=lua_gettop(m_pLS);
}
~_StackGuard()
{
lua_settop(m_pLS,m_nTop);
}
private:
int m_nTop;
lua_State *m_pLS;
};
#define _GUARD_STACK(ls) _StackGuard __guard__(ls);
#endif _STACKGUARD_H_