diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-11 15:41:09 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-11 15:41:09 -0300 |
| commit | a3d36fe283c09d4e56474da98f22d13162cc9fec (patch) | |
| tree | 1f6e2ed56d50dc14aa669fa5f31a63755abd4553 /lgc.h | |
| parent | 9569ad6b0ddcde43eb893d2cfe5bcdb715c0ff20 (diff) | |
| download | lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.gz lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.bz2 lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.zip | |
Upvalues collected like everything else (with mark-sweep) instead
of reference count (simpler and better for generational mode)
Diffstat (limited to 'lgc.h')
| -rw-r--r-- | lgc.h | 10 |
1 files changed, 1 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.h,v 2.94 2017/04/06 13:08:56 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.95 2017/04/10 13:33:04 roberto Exp roberto $ |
| 3 | ** Garbage Collector | 3 | ** Garbage Collector |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -124,8 +124,6 @@ | |||
| 124 | #define changeage(o,f,t) \ | 124 | #define changeage(o,f,t) \ |
| 125 | check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) | 125 | check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) |
| 126 | 126 | ||
| 127 | #define ongraylist(o) (isgray(o) || getage(o) == G_TOUCHED2) | ||
| 128 | |||
| 129 | 127 | ||
| 130 | /* | 128 | /* |
| 131 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' | 129 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' |
| @@ -153,10 +151,6 @@ | |||
| 153 | (isblack(p) && iswhite(o)) ? \ | 151 | (isblack(p) && iswhite(o)) ? \ |
| 154 | luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) | 152 | luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) |
| 155 | 153 | ||
| 156 | #define luaC_upvalbarrier(L,uv,x) ( \ | ||
| 157 | (iscollectable(x) && !upisopen(uv)) ? \ | ||
| 158 | luaC_upvalbarrier_(L,gcvalue(x)) : cast_void(0)) | ||
| 159 | |||
| 160 | LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); | 154 | LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); |
| 161 | LUAI_FUNC void luaC_freeallobjects (lua_State *L); | 155 | LUAI_FUNC void luaC_freeallobjects (lua_State *L); |
| 162 | LUAI_FUNC void luaC_step (lua_State *L); | 156 | LUAI_FUNC void luaC_step (lua_State *L); |
| @@ -165,9 +159,7 @@ LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); | |||
| 165 | LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); | 159 | LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); |
| 166 | LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); | 160 | LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); |
| 167 | LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); | 161 | LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); |
| 168 | LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, GCObject *o); | ||
| 169 | LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); | 162 | LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); |
| 170 | LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv); | ||
| 171 | LUAI_FUNC void luaC_changemode (lua_State *L, int newmode); | 163 | LUAI_FUNC void luaC_changemode (lua_State *L, int newmode); |
| 172 | 164 | ||
| 173 | 165 | ||
