From: John L. <jr...@us...> - 2007-07-19 03:09:54
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32730/wxLua/modules/wxbind/src Modified Files: wxbase_bind.cpp wxcore_bind.cpp wxcore_wxlprint.cpp wxhtml_wxlhtmlwin.cpp Log Message: Implement a better fix for the gc of duplicate pointers Don't track wxLuaFunctions, should be much faster now Make wxLuaState::RemoveTrackedMemory also clear the rest of the "tracking" info Index: wxcore_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_bind.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxcore_bind.cpp 16 Jul 2007 19:35:17 -0000 1.1 --- wxcore_bind.cpp 19 Jul 2007 03:09:46 -0000 1.2 *************** *** 5187,5202 **** } } ! void wxLuaBinding_wxcore::PostRegister(const wxLuaState& wxlState, bool registerTypes, int luaTable) { - wxLuaState wxLS(wxlState); - wxCHECK_RET(wxLS.Ok(), wxT("Invalid wxLuaState")); - lua_State* L = wxLS.GetLuaState(); - - if (registerTypes) - g_wxluatag_NULL = wxLS.tnewtag(); - - lua_pushlstring(L, "NULL", 4); - wxLS.tpushusertag(NULL, g_wxluatag_NULL); - lua_rawset(L, luaTable); } --- 5187,5192 ---- } } ! void wxLuaBinding_wxcore::PostRegister(const wxLuaState& , bool , int ) { } Index: wxcore_wxlprint.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_wxlprint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxcore_wxlprint.cpp 16 Jul 2007 19:35:21 -0000 1.1 --- wxcore_wxlprint.cpp 19 Jul 2007 03:09:46 -0000 1.2 *************** *** 56,60 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.LuaPCall(1, 4); --- 56,60 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.LuaPCall(1, 4); *************** *** 86,90 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.lua_PushNumber(pageNum); --- 86,90 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.lua_PushNumber(pageNum); *************** *** 135,139 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.lua_PushNumber(startPage); m_wxlState.lua_PushNumber(endPage); --- 135,139 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.lua_PushNumber(startPage); m_wxlState.lua_PushNumber(endPage); *************** *** 164,168 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); --- 164,168 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); *************** *** 180,184 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); --- 180,184 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); *************** *** 196,200 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); --- 196,200 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); *************** *** 212,216 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); --- 212,216 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); *************** *** 230,234 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.lua_PushNumber(pageNum); --- 230,234 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.lua_PushNumber(pageNum); *************** *** 252,256 **** { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); m_wxlState.lua_PushString(val); --- 252,256 ---- { int nOldTop = m_wxlState.lua_GetTop(); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout, true); m_wxlState.lua_PushString(val); Index: wxbase_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxbase_bind.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxbase_bind.cpp 16 Jul 2007 19:35:17 -0000 1.1 --- wxbase_bind.cpp 19 Jul 2007 03:09:46 -0000 1.2 *************** *** 2500,2504 **** lua_pushlstring(L, "NULL", 4); ! wxLS.tpushusertag(NULL, g_wxluatag_NULL); lua_rawset(L, luaTable); } --- 2500,2504 ---- lua_pushlstring(L, "NULL", 4); ! wxLS.tpushusertag(NULL, g_wxluatag_NULL, true); lua_rawset(L, luaTable); } Index: wxhtml_wxlhtmlwin.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxhtml_wxlhtmlwin.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxhtml_wxlhtmlwin.cpp 16 Jul 2007 19:35:22 -0000 1.1 --- wxhtml_wxlhtmlwin.cpp 19 Jul 2007 03:09:46 -0000 1.2 *************** *** 64,72 **** lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! m_wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell); lua_pushnumber(L, x); lua_pushnumber(L, y); ! m_wxlState.tpushusertag((void *) &event, s_wxluatag_wxMouseEvent); m_wxlState.LuaPCall(5, 1); --- 64,72 ---- lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow, true); ! m_wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell, true); lua_pushnumber(L, x); lua_pushnumber(L, y); ! m_wxlState.tpushusertag((void *) &event, s_wxluatag_wxMouseEvent, true); m_wxlState.LuaPCall(5, 1); *************** *** 103,108 **** lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! m_wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell); lua_pushnumber(L, x); lua_pushnumber(L, y); --- 103,108 ---- lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow, true); ! m_wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell, true); lua_pushnumber(L, x); lua_pushnumber(L, y); *************** *** 124,129 **** lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! m_wxlState.tpushusertag((void *) &link, s_wxluatag_wxHtmlLinkInfo); m_wxlState.LuaPCall(2, 0); --- 124,129 ---- lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow, true); ! m_wxlState.tpushusertag((void *) &link, s_wxluatag_wxHtmlLinkInfo, true); m_wxlState.LuaPCall(2, 0); *************** *** 143,147 **** lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); m_wxlState.lua_PushString(title); --- 143,147 ---- lua_State *L = m_wxlState.GetLuaState(); int nOldTop = lua_gettop(L); ! m_wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow, true); m_wxlState.lua_PushString(title); |