Parcourir la source

Manual GC collection

Vsevolod Levitan il y a 4 mois
Parent
commit
f4acd86493
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  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)