예제 #1
0
파일: gc.cs 프로젝트: wwkkww1983/ZJCredit
        public static void Collect(int generation, GCCollectionMode mode, bool blocking, bool compacting)
        {
            if (generation < 0)
            {
                throw new ArgumentOutOfRangeException("generation", Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
            }
            if (mode < GCCollectionMode.Default || mode > GCCollectionMode.Optimized)
            {
                throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum"));
            }
            int mode1 = 0;

            if (mode == GCCollectionMode.Optimized)
            {
                mode1 |= 4;
            }
            if (compacting)
            {
                mode1 |= 8;
            }
            if (blocking)
            {
                mode1 |= 2;
            }
            else if (!compacting)
            {
                mode1 |= 1;
            }
            GC._Collect(generation, mode1);
        }
예제 #2
0
파일: gc.cs 프로젝트: wwkkww1983/ZJCredit
 public static void Collect()
 {
     GC._Collect(-1, 2);
 }