lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> >> Can you check whether function traversestack is being called for Thread
> >> A (during the collection)?
> 
> Yes. Confirmed.

Is it possible to you to "instrument" this call, so you can see what
it is marking? You could put a printf in both loops, more or less like
this (not tested):

- for (o = l->stack; o < l->top; o++)
-   markvalue(g, o);
- for (; o <= lim; o++)
-   setnilvalue(o);

+ for (o = l->stack; o < l->top; o++) {
+   if (NOW) printf("marking %d\n", o->gch.tt);
+   markvalue(g, o);
+ }
+ for (; o <= lim; o++) {
+   if (NOW) printf("erasing %d\n", o->gch.tt);
+   setnilvalue(o);
+ }

(NOW can be a global variable that you set before the suspicious call to
lua_gc.) Then we can see what the collector is marking, what it is
erasing...

-- Roberto