Changeset 334
- Timestamp:
- 09/17/14 14:40:19 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_state.hh
r333 r334 23 23 #include <string> 24 24 25 #ifdef NV_DEBUG 26 #define NV_LUA_STACKASSERT( state, value ) nv::lua::stack_assert __lua_stack_assert( state, value ); 27 #else 28 #define NV_LUA_STACKASSERT( state, value ) 29 #endif 30 25 31 namespace nv 26 32 { … … 207 213 int m_level; 208 214 }; 215 216 class stack_assert 217 { 218 public: 219 stack_assert( state* aL, int expected ); 220 stack_assert( state& aL, int expected ); 221 stack_assert( lua_State* sL, int expected ); 222 ~stack_assert(); 223 private: 224 lua_State* L; 225 int m_expected; 226 }; 227 209 228 210 229 class table_guard; -
trunk/src/lua/lua_area.cc
r319 r334 403 403 static int luaopen_area( lua_State * L ) 404 404 { 405 NV_LUA_STACKASSERT( L, 0 ); 405 406 static const struct luaL_Reg nlua_area_sf [] = { 406 407 { "new", nlua_area_new }, -
trunk/src/lua/lua_state.cc
r333 r334 32 32 lua_settop( L->m_state, m_level ); 33 33 } 34 35 // stack_assert 36 nv::lua::stack_assert::stack_assert( lua::state* aL, int expected ) 37 : L(aL->get_raw()), m_expected( lua_gettop(aL->get_raw() ) + expected ) 38 { 39 40 } 41 42 nv::lua::stack_assert::stack_assert( lua::state& aL, int expected ) 43 : L(aL.get_raw()), m_expected( lua_gettop(aL.get_raw() ) + expected ) 44 { 45 46 } 47 48 nv::lua::stack_assert::stack_assert( lua_State* aL, int expected ) 49 : L(aL), m_expected( lua_gettop(aL) + expected ) 50 { 51 52 } 53 54 lua::stack_assert::~stack_assert() 55 { 56 NV_ASSERT( lua_gettop(L) == m_expected, "Lua stack corruption detected!" ); 57 } 58 34 59 35 60 // state_wrapper
Note: See TracChangeset
for help on using the changeset viewer.