OLD | NEW |
1 // If there is no window.gc() already defined, define one using the best | 1 // If there is no window.gc() already defined, define one using the best |
2 // method we can find. | 2 // method we can find. |
3 // The slow fallback should not hit in the actual test environment. | 3 // The slow fallback should not hit in the actual test environment. |
4 if (!window.gc) | 4 if (!window.gc) |
5 { | 5 { |
6 window.gc = function() | 6 window.gc = function() |
7 { | 7 { |
8 if (window.GCController) | 8 if (window.GCController) |
9 return GCController.collect(); | 9 return GCController.collect(); |
10 function gcRec(n) { | 10 function gcRec(n) { |
11 if (n < 1) | 11 if (n < 1) |
12 return {}; | 12 return {}; |
13 var temp = {i: "ab" + i + (i / 100000)}; | 13 var temp = {i: "ab" + i + (i / 100000)}; |
14 temp += "foo"; | 14 temp += "foo"; |
15 gcRec(n-1); | 15 gcRec(n-1); |
16 } | 16 } |
17 for (var i = 0; i < 10000; i++) | 17 for (var i = 0; i < 10000; i++) |
18 gcRec(10); | 18 gcRec(10); |
19 } | 19 } |
20 } | 20 } |
OLD | NEW |