Skip to content

Commit

Permalink
Try altenate method of clearing stack
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Dec 6, 2014
1 parent 748debc commit c3e2562
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/haxe/gc/TestGC.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ class TestGC extends haxe.unit.TestCase {
}

function gc():Dynamic {
// Put some dummy values on the stack
var a = createDummy(null);
var b = createDummy(a);
var c = createDummy(b);
var d = createDummy(c);
var e = createDummy(d);
var f = createDummy(e);
Gc.run(true);
return Gc.getNextZombie();
}
Expand All @@ -28,8 +21,17 @@ class TestGC extends haxe.unit.TestCase {
*/
function create(f:Void->Void):Void {
f();
clearStack(10);
}

function clearStack(count:Int, ?nothing:Dynamic):Dynamic
{
if (count==0)
return 0;
return clearStack(count-1);
}


function createAbc():Void {
var object = { test: "abc" };
Gc.doNotKill(object);
Expand Down

0 comments on commit c3e2562

Please sign in to comment.