author | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月29日 23:01:21 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月29日 23:01:21 +0200 |
commit | 176e096a8e6923c06395ba3668eb38c69257116b (patch) | |
tree | 8cb4ee3f2200fef1150ee28aef815dbaad72c84c /lua/src/lgc.c | |
parent | 32cb1ed9940cbfb02fc1fc73ef2e73a2b30e516b (diff) | |
download | gsl-shell-176e096a8e6923c06395ba3668eb38c69257116b.tar.gz |
-rw-r--r-- | lua/src/lgc.c | 13 |
diff --git a/lua/src/lgc.c b/lua/src/lgc.c index d9e0b782..83bbc4c2 100644 --- a/lua/src/lgc.c +++ b/lua/src/lgc.c @@ -334,6 +334,17 @@ static size_t propagateall (global_State *g) { ** other objects: if really collected, cannot keep them; for userdata ** being finalized, keep them in keys, but not in values */ +#ifdef GSL_SHELL_LUA +static int iscleared (const TValue *o, int iskey) { + (void) iskey; + if (!iscollectable(o)) return 0; + if (ttisstring(o)) { + stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */ + return 0; + } + return iswhite(gcvalue(o)) || (ttisuserdata(o) && isfinalized(uvalue(o))); +} +#else static int iscleared (const TValue *o, int iskey) { if (!iscollectable(o)) return 0; if (ttisstring(o)) { @@ -343,7 +354,7 @@ static int iscleared (const TValue *o, int iskey) { return iswhite(gcvalue(o)) || (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); } - +#endif /* ** clear collected entries from weaktables |