Garbage has been collected

Sunday, February 20, 2011
I've managed to successfully run a garbage collection cycle without causing a crash:

def testCollect {
  // Allocate a string that's not a constant.
  var sampleString = String.format("a{0}", "b");
  // Force a collection
  tart.gc.GC.collect();
  // Ensure that the string is still valid.
  assertEq("ab", sampleString);
}

Woot.

0 comments:

Post a Comment