Skip to content

Commit

Permalink
A few more tiny adjustments to ropes
Browse files Browse the repository at this point in the history
This is technically still leaking, but I need to get this release out.
  • Loading branch information
MCJack123 committed Nov 7, 2022
1 parent 8547cbd commit 9f3507d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lgc.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int traversetable (global_State *g, Table *h) {
if (weakkey && weakvalue) return 1;
i = h->sizearray;
while (i--)
if (!weakvalue || ttisrope(&h->array[i]) || ttissubstr(&h->array[i])) markvalue(g, &h->array[i]);
if (!weakvalue) markvalue(g, &h->array[i]);
i = sizenode(h);
while (i--) {
Node *n = gnode(h, i);
Expand All @@ -196,8 +196,8 @@ static int traversetable (global_State *g, Table *h) {
removeentry(n); /* remove empty entries */
else {
lua_assert(!ttisnil(gkey(n)));
if (!weakkey || ttisrope(gkey(n)) || ttissubstr(gkey(n))) markvalue(g, gkey(n));
if (!weakvalue || ttisrope(gval(n)) || ttissubstr(gval(n))) markvalue(g, gval(n));
if (!weakkey) markvalue(g, gkey(n));
if (!weakvalue) markvalue(g, gval(n));
}
}
return weakkey || weakvalue;
Expand Down
1 change: 1 addition & 0 deletions src/lstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ TString *luaS_build (lua_State *L, TRope *rope) {
/* (apparently this is a problem?) */
resetbits(s->tsv.marked, WHITEBITS);
setbits(s->tsv.marked, bitmask(BLACKBIT));
luaC_step(L); /* try to let the old rope get freed */
return s;
}

Expand Down

0 comments on commit 9f3507d

Please sign in to comment.