aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lgc.c b/lgc.c
index 8661fe8d..8d273d44 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.154 2013/08/27 20:04:00 roberto Exp roberto $ 2** $Id: lgc.c,v 2.155 2013/08/28 18:30:26 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*/
@@ -25,7 +25,7 @@
25 25
26 26
27/* 27/*
28** How memory to allocate before a new local collection 28** How much memory to allocate before a new local collection
29*/ 29*/
30#define GCLOCALPAUSE 8000 30#define GCLOCALPAUSE 8000
31 31
@@ -894,12 +894,15 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
894*/ 894*/
895static void localmarkthread (lua_State *l) { 895static void localmarkthread (lua_State *l) {
896 StkId o = l->stack; 896 StkId o = l->stack;
897 StkId lim = l->stack + l->stacksize; /* real end of stack */
897 if (o == NULL) 898 if (o == NULL)
898 return; /* stack not completely built yet */ 899 return; /* stack not completely built yet */
899 for (; o < l->top; o++) { /* mark live elements in the stack */ 900 for (; o < l->top; o++) { /* mark live elements in the stack */
900 if (iscollectable(o)) 901 if (iscollectable(o))
901 l_setbit(gcvalue(o)->gch.marked, LOCALMARK); 902 l_setbit(gcvalue(o)->gch.marked, LOCALMARK);
902 } 903 }
904 for (; o < lim; o++) /* clear not-marked stack slice */
905 setnilvalue(o);
903} 906}
904 907
905 908