aboutsummaryrefslogtreecommitdiff
path: root/src/lj_gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r--src/lj_gc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index b97fb955..b457c424 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -186,13 +186,10 @@ static int gc_traverse_tab(global_State *g, GCtab *t)
186 MSize i, hmask = t->hmask; 186 MSize i, hmask = t->hmask;
187 for (i = 0; i <= hmask; i++) { 187 for (i = 0; i <= hmask; i++) {
188 Node *n = &node[i]; 188 Node *n = &node[i];
189 lua_assert(itype(&n->key) != LJ_TDEADKEY || tvisnil(&n->val));
190 if (!tvisnil(&n->val)) { /* Mark non-empty slot. */ 189 if (!tvisnil(&n->val)) { /* Mark non-empty slot. */
191 lua_assert(!tvisnil(&n->key)); 190 lua_assert(!tvisnil(&n->key));
192 if (!(weak & LJ_GC_WEAKKEY)) gc_marktv(g, &n->key); 191 if (!(weak & LJ_GC_WEAKKEY)) gc_marktv(g, &n->key);
193 if (!(weak & LJ_GC_WEAKVAL)) gc_marktv(g, &n->val); 192 if (!(weak & LJ_GC_WEAKVAL)) gc_marktv(g, &n->val);
194 } else if (tvisgcv(&n->key)) { /* Leave GC key in, but mark as dead. */
195 setitype(&n->key, LJ_TDEADKEY);
196 } 193 }
197 } 194 }
198 } 195 }
@@ -424,11 +421,8 @@ static void gc_clearweak(GCobj *o)
424 Node *n = &node[i]; 421 Node *n = &node[i];
425 /* Clear hash slot when key or value is about to be collected. */ 422 /* Clear hash slot when key or value is about to be collected. */
426 if (!tvisnil(&n->val) && (gc_mayclear(&n->key, 0) || 423 if (!tvisnil(&n->val) && (gc_mayclear(&n->key, 0) ||
427 gc_mayclear(&n->val, 1))) { 424 gc_mayclear(&n->val, 1)))
428 setnilV(&n->val); 425 setnilV(&n->val);
429 if (tvisgcv(&n->key)) /* Leave GC key in, but mark as dead. */
430 setitype(&n->key, LJ_TDEADKEY);
431 }
432 } 426 }
433 } 427 }
434 o = gcref(t->gclist); 428 o = gcref(t->gclist);