cleaner code for manipulation of `marked' field

This commit is contained in:
Roberto Ierusalimschy
2003-11-17 17:50:05 -02:00
parent 921b1723e2
commit ab7d9bfd0c
5 changed files with 69 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lfunc.c,v 1.68 2003/10/02 19:21:09 roberto Exp roberto $
** $Id: lfunc.c,v 1.69 2003/10/20 17:42:41 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ -64,7 +64,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
}
v = luaM_new(L, UpVal); /* not found: create a new one */
v->tt = LUA_TUPVAL;
v->marked = 1; /* open upvalues should not be collected */
v->marked = bitmask(BLACKBIT); /* open upvalues should not be collected */
v->v = level; /* current value lives in the stack */
v->next = *pp; /* chain it in the proper position */
*pp = valtogco(v);