diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-20 16:00:19 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-20 16:00:19 -0200 |
commit | caf82787100985ceee400a85723ccdad2a2efe24 (patch) | |
tree | e9573227728d5b62ba571dd54ec94dbb084a28b7 /lgc.h | |
parent | f7670781cf67a4bfb0799d1800a87b2c4a19ad59 (diff) | |
download | lua-caf82787100985ceee400a85723ccdad2a2efe24.tar.gz lua-caf82787100985ceee400a85723ccdad2a2efe24.tar.bz2 lua-caf82787100985ceee400a85723ccdad2a2efe24.zip |
added comments
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.87 2015/08/03 19:40:42 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.88 2015/10/20 17:56:21 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 | */ |
@@ -101,9 +101,16 @@ | |||
101 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) | 101 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
102 | 102 | ||
103 | 103 | ||
104 | /* | ||
105 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' | ||
106 | ** allows some adjustments to be done only when needed. macro | ||
107 | ** 'condchangemem' is used only for heavy tests (forcing a full | ||
108 | ** GC cycle on every opportunity) | ||
109 | */ | ||
104 | #define luaC_condGC(L,pre,pos) \ | 110 | #define luaC_condGC(L,pre,pos) \ |
105 | {if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; condchangemem(L);} | 111 | {if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; condchangemem(L);} |
106 | 112 | ||
113 | /* more often than not, 'pre'/'pos' are empty */ | ||
107 | #define luaC_checkGC(L) luaC_condGC(L,,) | 114 | #define luaC_checkGC(L) luaC_condGC(L,,) |
108 | 115 | ||
109 | 116 | ||