mirror of https://github.com/rusefi/lua.git
subtle problem with the garbage collector
This commit is contained in:
parent
20f4bbdc3a
commit
ad0765b4f0
30
bugs
30
bugs
|
@ -925,7 +925,7 @@ patch = [[
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Bug{
|
Bug{
|
||||||
what = [[lua_dostring/lua_dofile should return any values returned
|
what = [[lua_dostring/lua_dofile should return any values returned
|
||||||
by the chunk]],
|
by the chunk]],
|
||||||
|
|
||||||
|
@ -946,3 +946,31 @@ patch = [[
|
||||||
]],
|
]],
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Bug{
|
||||||
|
|
||||||
|
what = [[garbage collector does not compensate enough for finalizers]],
|
||||||
|
|
||||||
|
patch = [[
|
||||||
|
lgc.c:
|
||||||
|
@@ -322,4 +322,6 @@
|
||||||
|
|
||||||
|
-static void propagateall (global_State *g) {
|
||||||
|
- while (g->gray) propagatemark(g);
|
||||||
|
+static size_t propagateall (global_State *g) {
|
||||||
|
+ size_t m = 0;
|
||||||
|
+ while (g->gray) m += propagatemark(g);
|
||||||
|
+ return m;
|
||||||
|
}
|
||||||
|
@@ -542,3 +544,3 @@
|
||||||
|
marktmu(g); /* mark `preserved' userdata */
|
||||||
|
- propagateall(g); /* remark, to propagate `preserveness' */
|
||||||
|
+ udsize += propagateall(g); /* remark, to propagate `preserveness' */
|
||||||
|
cleartable(g->weak); /* remove collected objects from weak tables */
|
||||||
|
@@ -592,2 +594,4 @@
|
||||||
|
GCTM(L);
|
||||||
|
+ if (g->estimate > GCFINALIZECOST)
|
||||||
|
+ g->estimate -= GCFINALIZECOST;
|
||||||
|
]]
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue