field 'op' renamed to 'open'

This commit is contained in:
Roberto Ierusalimschy 2014-02-15 11:12:01 -02:00
parent 6a24bd17a8
commit ffa96d988d
6 changed files with 17 additions and 17 deletions

4
lapi.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lapi.c,v 2.195 2014/02/13 17:25:20 roberto Exp roberto $ ** $Id: lapi.c,v 2.196 2014/02/14 16:43:14 roberto Exp roberto $
** Lua API ** Lua API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -1296,7 +1296,7 @@ LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
luaC_upvdeccount(L, *up1); luaC_upvdeccount(L, *up1);
*up1 = *up2; *up1 = *up2;
(*up1)->refcount++; (*up1)->refcount++;
if (upisopen(*up1)) (*up1)->u.op.touched = 1; if (upisopen(*up1)) (*up1)->u.open.touched = 1;
luaC_upvalbarrier(L, *up1); luaC_upvalbarrier(L, *up1);
} }

4
ldo.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldo.c,v 2.111 2013/09/17 15:40:06 roberto Exp roberto $ ** $Id: ldo.c,v 2.112 2013/11/08 18:16:33 roberto Exp roberto $
** Stack and Call structure of Lua ** Stack and Call structure of Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -143,7 +143,7 @@ static void correctstack (lua_State *L, TValue *oldstack) {
CallInfo *ci; CallInfo *ci;
UpVal *up; UpVal *up;
L->top = (L->top - oldstack) + L->stack; L->top = (L->top - oldstack) + L->stack;
for (up = L->openupval; up != NULL; up = up->u.op.next) for (up = L->openupval; up != NULL; up = up->u.open.next)
up->v = (up->v - oldstack) + L->stack; up->v = (up->v - oldstack) + L->stack;
for (ci = L->ci; ci != NULL; ci = ci->previous) { for (ci = L->ci; ci != NULL; ci = ci->previous) {
ci->top = (ci->top - oldstack) + L->stack; ci->top = (ci->top - oldstack) + L->stack;

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lfunc.c,v 2.38 2013/09/11 12:26:14 roberto Exp roberto $ ** $Id: lfunc.c,v 2.39 2014/02/13 12:11:34 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures ** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -56,12 +56,12 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
lua_assert(upisopen(p)); lua_assert(upisopen(p));
if (p->v == level) /* found a corresponding upvalue? */ if (p->v == level) /* found a corresponding upvalue? */
return p; /* return it */ return p; /* return it */
pp = &p->u.op.next; pp = &p->u.open.next;
} }
/* not found: create a new one */ /* not found: create a new one */
uv = luaM_new(L, UpVal); uv = luaM_new(L, UpVal);
uv->refcount = 0; uv->refcount = 0;
uv->u.op.next = *pp; uv->u.open.next = *pp;
*pp = uv; *pp = uv;
uv->v = level; /* current value lives in the stack */ uv->v = level; /* current value lives in the stack */
return uv; return uv;
@ -72,7 +72,7 @@ void luaF_close (lua_State *L, StkId level) {
UpVal *uv; UpVal *uv;
while (L->openupval != NULL && (uv = L->openupval)->v >= level) { while (L->openupval != NULL && (uv = L->openupval)->v >= level) {
lua_assert(upisopen(uv)); lua_assert(upisopen(uv));
L->openupval = uv->u.op.next; /* remove from `open' list */ L->openupval = uv->u.open.next; /* remove from `open' list */
if (uv->refcount == 0) /* no references? */ if (uv->refcount == 0) /* no references? */
luaM_free(L, uv); /* free upvalue */ luaM_free(L, uv); /* free upvalue */
else { else {

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lfunc.h,v 2.10 2013/08/27 18:53:35 roberto Exp roberto $ ** $Id: lfunc.h,v 2.11 2013/09/11 15:17:00 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures ** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -28,7 +28,7 @@ struct UpVal {
struct { /* (when open) */ struct { /* (when open) */
UpVal *next; /* linked list */ UpVal *next; /* linked list */
int touched; /* mark to avoid cycles with dead threads */ int touched; /* mark to avoid cycles with dead threads */
} op; } open;
TValue value; /* the value (when closed) */ TValue value; /* the value (when closed) */
} u; } u;
}; };

10
lgc.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lgc.c,v 2.173 2014/02/13 17:25:20 roberto Exp roberto $ ** $Id: lgc.c,v 2.174 2014/02/14 16:43:14 roberto Exp roberto $
** Garbage Collector ** Garbage Collector
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -296,10 +296,10 @@ static void remarkupvals (global_State *g) {
lua_assert(!isblack(thread)); /* threads are never black */ lua_assert(!isblack(thread)); /* threads are never black */
if (!isgray(thread)) { /* dead thread? */ if (!isgray(thread)) { /* dead thread? */
UpVal *uv = gco2th(thread)->openupval; UpVal *uv = gco2th(thread)->openupval;
for (; uv != NULL; uv = uv->u.op.next) { for (; uv != NULL; uv = uv->u.open.next) {
if (uv->u.op.touched) { if (uv->u.open.touched) {
markvalue(g, uv->v); /* remark upvalue's value */ markvalue(g, uv->v); /* remark upvalue's value */
uv->u.op.touched = 0; uv->u.open.touched = 0;
} }
} }
} }
@ -466,7 +466,7 @@ static lu_mem traverseLclosure (global_State *g, LClosure *cl) {
UpVal *uv = cl->upvals[i]; UpVal *uv = cl->upvals[i];
if (uv != NULL) { if (uv != NULL) {
if (upisopen(uv)) if (upisopen(uv))
uv->u.op.touched = 1; /* can be marked in 'remarkupvals' */ uv->u.open.touched = 1; /* can be marked in 'remarkupvals' */
else else
markvalue(g, uv->v); markvalue(g, uv->v);
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltests.c,v 2.163 2014/02/11 12:18:12 roberto Exp roberto $ ** $Id: ltests.c,v 2.164 2014/02/13 12:11:34 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation ** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -301,7 +301,7 @@ static void checkstack (global_State *g, lua_State *L1) {
CallInfo *ci; CallInfo *ci;
UpVal *uv; UpVal *uv;
lua_assert(!isdead(g, obj2gco(L1))); lua_assert(!isdead(g, obj2gco(L1)));
for (uv = L1->openupval; uv != NULL; uv = uv->u.op.next) for (uv = L1->openupval; uv != NULL; uv = uv->u.open.next)
lua_assert(upisopen(uv)); /* must be open */ lua_assert(upisopen(uv)); /* must be open */
for (ci = L1->ci; ci != NULL; ci = ci->previous) { for (ci = L1->ci; ci != NULL; ci = ci->previous) {
lua_assert(ci->top <= L1->stack_last); lua_assert(ci->top <= L1->stack_last);