summaryrefslogtreecommitdiff
path: root/lua/lgc.c
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-09-11 23:20:16 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-09-11 23:20:16 +0200
commita1eb1f41d91572fc0ad4f8805d946c8bdbdb8d2a (patch)
tree835026e58e9586283893445133570cd526f78857 /lua/lgc.c
parent32419bbba54b1e3847d5890d990edf7012a7dada (diff)
downloadlibrpm-tizen-a1eb1f41d91572fc0ad4f8805d946c8bdbdb8d2a.tar.gz
librpm-tizen-a1eb1f41d91572fc0ad4f8805d946c8bdbdb8d2a.tar.bz2
librpm-tizen-a1eb1f41d91572fc0ad4f8805d946c8bdbdb8d2a.zip
Remove splint tags.
Diffstat (limited to 'lua/lgc.c')
-rw-r--r--lua/lgc.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/lua/lgc.c b/lua/lgc.c
index f2c60936a..90b2a9405 100644
--- a/lua/lgc.c
+++ b/lua/lgc.c
@@ -23,15 +23,10 @@
typedef struct GCState {
-/*@null@*/
GCObject *tmark; /* list of marked objects to be traversed */
-/*@null@*/
GCObject *wk; /* list of traversed key-weak tables (to be cleared) */
-/*@null@*/
GCObject *wv; /* list of traversed value-weak tables */
-/*@null@*/
GCObject *wkv; /* list of traversed key-value weak tables */
-/*@null@*/
global_State *g;
} GCState;
@@ -73,7 +68,6 @@ typedef struct GCState {
static void reallymarkobject (GCState *st, GCObject *o)
- /*@modifies st, o @*/
{
lua_assert(!ismarked(o));
setbit(o->gch.marked, 0); /* mark object */
@@ -93,9 +87,7 @@ static void reallymarkobject (GCState *st, GCObject *o)
break;
}
case LUA_TTHREAD: {
-/*@-onlytrans@*/
gcototh(o)->gclist = st->tmark;
-/*@=onlytrans@*/
st->tmark = o;
break;
}
@@ -110,7 +102,6 @@ static void reallymarkobject (GCState *st, GCObject *o)
static void marktmu (GCState *st)
- /*@modifies st @*/
{
GCObject *u;
for (u = st->g->tmudata; u; u = u->gch.next) {
@@ -145,16 +136,13 @@ size_t luaC_separateudata (lua_State *L) {
}
}
/* insert collected udata with gc event into `tmudata' list */
-/*@-dependenttrans@*/
*lastcollected = G(L)->tmudata;
-/*@=dependenttrans@*/
G(L)->tmudata = collected;
return deadmem;
}
static void removekey (Node *n)
- /*@modifies n @*/
{
setnilvalue(gval(n)); /* remove corresponding value ... */
if (iscollectable(gkey(n)))
@@ -163,7 +151,6 @@ static void removekey (Node *n)
static void traversetable (GCState *st, Table *h)
- /*@modifies st, h @*/
{
int i;
int weakkey = 0;
@@ -205,7 +192,6 @@ static void traversetable (GCState *st, Table *h)
static void traverseproto (GCState *st, Proto *f)
- /*@modifies st, f @*/
{
int i;
stringmark(f->source);
@@ -225,7 +211,6 @@ static void traverseproto (GCState *st, Proto *f)
static void traverseclosure (GCState *st, Closure *cl)
- /*@modifies st, cl @*/
{
if (cl->c.isC) {
int i;
@@ -249,7 +234,6 @@ static void traverseclosure (GCState *st, Closure *cl)
static void checkstacksizes (lua_State *L, StkId max)
- /*@modifies L @*/
{
int used = L->ci - L->base_ci; /* number of `ci' in use */
if (4*used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
@@ -263,7 +247,6 @@ static void checkstacksizes (lua_State *L, StkId max)
static void traversestack (GCState *st, lua_State *L1)
- /*@modifies st, L1 @*/
{
StkId o, lim;
CallInfo *ci;
@@ -284,7 +267,6 @@ static void traversestack (GCState *st, lua_State *L1)
static void propagatemarks (GCState *st)
- /*@modifies st @*/
{
while (st->tmark) { /* traverse marked objects */
switch (st->tmark->gch.tt) {
@@ -302,9 +284,7 @@ static void propagatemarks (GCState *st)
}
case LUA_TTHREAD: {
lua_State *th = gcototh(st->tmark);
-/*@-dependenttrans@*/
st->tmark = th->gclist;
-/*@=dependenttrans@*/
traversestack(st, th);
break;
}
@@ -321,7 +301,6 @@ static void propagatemarks (GCState *st)
static int valismarked (const TObject *o)
- /*@modifies o @*/
{
if (ttisstring(o))
stringmark(tsvalue(o)); /* strings are `values', so are never weak */
@@ -332,8 +311,7 @@ static int valismarked (const TObject *o)
/*
** clear collected keys from weaktables
*/
-static void cleartablekeys (/*@null@*/ GCObject *l)
- /*@modifies l @*/
+static void cleartablekeys (GCObject *l)
{
while (l) {
Table *h = gcotoh(l);
@@ -352,8 +330,7 @@ static void cleartablekeys (/*@null@*/ GCObject *l)
/*
** clear collected values from weaktables
*/
-static void cleartablevalues (/*@null@*/ GCObject *l)
- /*@modifies l @*/
+static void cleartablevalues (GCObject *l)
{
while (l) {
Table *h = gcotoh(l);
@@ -376,7 +353,6 @@ static void cleartablevalues (/*@null@*/ GCObject *l)
static void freeobj (lua_State *L, GCObject *o)
- /*@modifies L, o @*/
{
switch (o->gch.tt) {
case LUA_TPROTO: luaF_freeproto(L, gcotop(o)); break;
@@ -402,7 +378,6 @@ static void freeobj (lua_State *L, GCObject *o)
static int sweeplist (lua_State *L, GCObject **p, int limit)
- /*@modifies L, *p @*/
{
GCObject *curr;
int count = 0; /* number of collected items */
@@ -413,9 +388,7 @@ static int sweeplist (lua_State *L, GCObject **p, int limit)
}
else {
count++;
-/*@-dependenttrans@*/
*p = curr->gch.next;
-/*@=dependenttrans@*/
freeobj(L, curr);
}
}
@@ -424,7 +397,6 @@ static int sweeplist (lua_State *L, GCObject **p, int limit)
static void sweepstrings (lua_State *L, int all)
- /*@modifies L @*/
{
int i;
for (i=0; i<G(L)->strt.size; i++) { /* for each list */
@@ -434,7 +406,6 @@ static void sweepstrings (lua_State *L, int all)
static void checkSizes (lua_State *L, size_t deadmem)
- /*@modifies L @*/
{
/* check size of string hash */
if (G(L)->strt.nuse < cast(ls_nstr, G(L)->strt.size/4) &&
@@ -450,7 +421,6 @@ static void checkSizes (lua_State *L, size_t deadmem)
static void do1gcTM (lua_State *L, Udata *udata)
- /*@modifies L, udata @*/
{
const TObject *tm = fasttm(L, udata->uv.metatable, TM_GC);
if (tm != NULL) {
@@ -492,7 +462,6 @@ void luaC_sweep (lua_State *L, int all) {
/* mark root set */
static void markroot (GCState *st, lua_State *L)
- /*@modifies st, L @*/
{
global_State *g = st->g;
markobject(st, defaultmeta(L));
@@ -504,7 +473,6 @@ static void markroot (GCState *st, lua_State *L)
static size_t mark (lua_State *L)
- /*@modifies L @*/
{
size_t deadmem;
GCState st;