summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-03-20 09:49:30 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-03-20 09:49:30 -0300
commit2c8206d448fe05b94d3841e9e2472e78e6aadc13 (patch)
tree4cfa50071167ee657124531b4ba11660b3da2dc1
parentae76307847efa83df131fd9ad3180982131b8c72 (diff)
downloadlua-2c8206d448fe05b94d3841e9e2472e78e6aadc13.tar.gz
lua-2c8206d448fe05b94d3841e9e2472e78e6aadc13.tar.bz2
lua-2c8206d448fe05b94d3841e9e2472e78e6aadc13.zip
bug in Lua 4.0.2: weak tables that survive one collection are never collected
-rw-r--r--bugs37
1 files changed, 35 insertions, 2 deletions
diff --git a/bugs b/bugs
index a537f84e..27bf71d0 100644
--- a/bugs
+++ b/bugs
@@ -1,4 +1,4 @@
1--[[ 1--[=[
2** lua.stx / llex.c 2** lua.stx / llex.c
3Tue Dec 2 10:45:48 EDT 1997 3Tue Dec 2 10:45:48 EDT 1997
4>> BUG: "lastline" was not reset on function entry, so debug information 4>> BUG: "lastline" was not reset on function entry, so debug information
@@ -336,7 +336,7 @@ Thu Mar 20 11:40:12 EST 2003
336 336
337 337
338 338
339--]] 339--]=]
340----------------------------------------------------------------- 340-----------------------------------------------------------------
341-- Lua 5.0 (final) 341-- Lua 5.0 (final)
342 342
@@ -764,3 +764,36 @@ patch = [[
764]], 764]],
765} 765}
766 766
767
768Bug{
769what = [[weak tables that survive one collection are never collected]],
770
771report = [[Chromix, 02/01/2006]],
772
773example = [[
774a = {}
775print(gcinfo())
776for i = 1, 10000 do
777 a[i] = setmetatable({}, {__mode = "v"})
778end
779collectgarbage()
780a = nil
781collectgarbage()
782print(gcinfo())
783]],
784
785patch = [[
786* lgc.c
787@@ -366,7 +366,7 @@
788 GCObject *curr;
789 int count = 0; /* number of collected items */
790 while ((curr = *p) != NULL) {
791- if (curr->gch.marked > limit) {
792+ if ((curr->gch.marked & ~(KEYWEAK | VALUEWEAK)) > limit) {
793 unmark(curr);
794 p = &curr->gch.next;
795 }
796]],
797
798}
799