eris: weak tables fixed (garbage collector updates sequence data)
This commit is contained in:
@@ -628,7 +628,7 @@ static void clearkeys (global_State *g, GCObject *l, GCObject *f) {
|
||||
Node *n, *limit = gnodelast(h);
|
||||
for (n = gnode(h, 0); n < limit; n++) {
|
||||
if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) {
|
||||
setnilvalue(gval(n)); /* remove value ... */
|
||||
luaH_setnil(h, ganode(n));
|
||||
removeentry(n); /* and remove entry from table */
|
||||
}
|
||||
}
|
||||
@@ -646,13 +646,14 @@ static void clearvalues (global_State *g, GCObject *l, GCObject *f) {
|
||||
Node *n, *limit = gnodelast(h);
|
||||
int i;
|
||||
for (i = 0; i < h->sizearray; i++) {
|
||||
ANode *anode = h->array + i;
|
||||
TValue *o = &h->array[i].i_val;
|
||||
if (iscleared(g, o)) /* value was collected? */
|
||||
setnilvalue(o); /* remove value */
|
||||
if (iscleared(g, &anode->i_val)) /* value was collected? */
|
||||
luaH_setnil(h, anode);
|
||||
}
|
||||
for (n = gnode(h, 0); n < limit; n++) {
|
||||
if (!ttisnil(gval(n)) && iscleared(g, gval(n))) {
|
||||
setnilvalue(gval(n)); /* remove value ... */
|
||||
luaH_setnil(h, ganode(n)); /* remove value ... */
|
||||
removeentry(n); /* and remove entry from table */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user