瀏覽代碼

Manual GC collection

Vsevolod Levitan 4 月之前
父節點
當前提交
f4acd86493
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Program.cs

+ 2 - 0
Program.cs

@@ -59,6 +59,8 @@ internal class Program
         Console.WriteLine(board);
 
         Console.Write("Your move: ");
+        GC.Collect(2, GCCollectionMode.Aggressive);
+        GC.WaitForFullGCComplete();
         board.PlaceCoin(Player.Human, int.Parse(Console.ReadLine()!) - 1);
 
         if (board.GetWinner() == Player.Human)