aboutsummaryrefslogtreecommitdiff
path: root/lgc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.h')
-rw-r--r--lgc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lgc.h b/lgc.h
index 4501db51..0d77edb5 100644
--- a/lgc.h
+++ b/lgc.h
@@ -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