mirror of
https://github.com/lua/lua.git
synced 2024-11-23 18:23:43 +08:00
field 'op' renamed to 'open'
This commit is contained in:
parent
6a24bd17a8
commit
ffa96d988d
4
lapi.c
4
lapi.c
@ -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
|
||||
** 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);
|
||||
*up1 = *up2;
|
||||
(*up1)->refcount++;
|
||||
if (upisopen(*up1)) (*up1)->u.op.touched = 1;
|
||||
if (upisopen(*up1)) (*up1)->u.open.touched = 1;
|
||||
luaC_upvalbarrier(L, *up1);
|
||||
}
|
||||
|
||||
|
4
ldo.c
4
ldo.c
@ -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
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -143,7 +143,7 @@ static void correctstack (lua_State *L, TValue *oldstack) {
|
||||
CallInfo *ci;
|
||||
UpVal *up;
|
||||
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;
|
||||
for (ci = L->ci; ci != NULL; ci = ci->previous) {
|
||||
ci->top = (ci->top - oldstack) + L->stack;
|
||||
|
8
lfunc.c
8
lfunc.c
@ -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
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -56,12 +56,12 @@ UpVal *luaF_findupval (lua_State *L, StkId level) {
|
||||
lua_assert(upisopen(p));
|
||||
if (p->v == level) /* found a corresponding upvalue? */
|
||||
return p; /* return it */
|
||||
pp = &p->u.op.next;
|
||||
pp = &p->u.open.next;
|
||||
}
|
||||
/* not found: create a new one */
|
||||
uv = luaM_new(L, UpVal);
|
||||
uv->refcount = 0;
|
||||
uv->u.op.next = *pp;
|
||||
uv->u.open.next = *pp;
|
||||
*pp = uv;
|
||||
uv->v = level; /* current value lives in the stack */
|
||||
return uv;
|
||||
@ -72,7 +72,7 @@ void luaF_close (lua_State *L, StkId level) {
|
||||
UpVal *uv;
|
||||
while (L->openupval != NULL && (uv = L->openupval)->v >= level) {
|
||||
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? */
|
||||
luaM_free(L, uv); /* free upvalue */
|
||||
else {
|
||||
|
4
lfunc.h
4
lfunc.h
@ -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
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -28,7 +28,7 @@ struct UpVal {
|
||||
struct { /* (when open) */
|
||||
UpVal *next; /* linked list */
|
||||
int touched; /* mark to avoid cycles with dead threads */
|
||||
} op;
|
||||
} open;
|
||||
TValue value; /* the value (when closed) */
|
||||
} u;
|
||||
};
|
||||
|
10
lgc.c
10
lgc.c
@ -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
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -296,10 +296,10 @@ static void remarkupvals (global_State *g) {
|
||||
lua_assert(!isblack(thread)); /* threads are never black */
|
||||
if (!isgray(thread)) { /* dead thread? */
|
||||
UpVal *uv = gco2th(thread)->openupval;
|
||||
for (; uv != NULL; uv = uv->u.op.next) {
|
||||
if (uv->u.op.touched) {
|
||||
for (; uv != NULL; uv = uv->u.open.next) {
|
||||
if (uv->u.open.touched) {
|
||||
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];
|
||||
if (uv != NULL) {
|
||||
if (upisopen(uv))
|
||||
uv->u.op.touched = 1; /* can be marked in 'remarkupvals' */
|
||||
uv->u.open.touched = 1; /* can be marked in 'remarkupvals' */
|
||||
else
|
||||
markvalue(g, uv->v);
|
||||
}
|
||||
|
4
ltests.c
4
ltests.c
@ -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
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -301,7 +301,7 @@ static void checkstack (global_State *g, lua_State *L1) {
|
||||
CallInfo *ci;
|
||||
UpVal *uv;
|
||||
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 */
|
||||
for (ci = L1->ci; ci != NULL; ci = ci->previous) {
|
||||
lua_assert(ci->top <= L1->stack_last);
|
||||
|
Loading…
Reference in New Issue
Block a user