TObject' renamed to TValue' + other name changes and better assertions
for incremental garbage collection
This commit is contained in:
10
ltm.c
10
ltm.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltm.c,v 1.106 2003/04/03 13:35:34 roberto Exp roberto $
|
||||
** $Id: ltm.c,v 1.107 2003/12/01 18:22:56 roberto Exp roberto $
|
||||
** Tag methods
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -45,8 +45,8 @@ void luaT_init (lua_State *L) {
|
||||
** function to be used with macro "fasttm": optimized for absence of
|
||||
** tag methods
|
||||
*/
|
||||
const TObject *luaT_gettm (Table *events, TMS event, TString *ename) {
|
||||
const TObject *tm = luaH_getstr(events, ename);
|
||||
const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
|
||||
const TValue *tm = luaH_getstr(events, ename);
|
||||
lua_assert(event <= TM_EQ);
|
||||
if (ttisnil(tm)) { /* no tag method? */
|
||||
events->flags |= cast(lu_byte, 1u<<event); /* cache this fact */
|
||||
@@ -56,14 +56,14 @@ const TObject *luaT_gettm (Table *events, TMS event, TString *ename) {
|
||||
}
|
||||
|
||||
|
||||
const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event) {
|
||||
const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
|
||||
Table *mt;
|
||||
switch (ttype(o)) {
|
||||
case LUA_TTABLE:
|
||||
mt = hvalue(o)->metatable;
|
||||
break;
|
||||
case LUA_TUSERDATA:
|
||||
mt = uvalue(o)->uv.metatable;
|
||||
mt = uvalue(o)->metatable;
|
||||
break;
|
||||
default:
|
||||
mt = NULL;
|
||||
|
||||
Reference in New Issue
Block a user