Exemple #1
0
        internal static new void Initialize()
        {
            if (gcCountTable != null)
            {
                return;
            }
            StopTheWorldCollector.Initialize();
            defaultGeneration = MAX_GENERATION;
            uint tableSize = (uint)MAX_GENERATION + 1;

            nurserySize = (UIntPtr)(1 << 24);
            // gcCountTable = new short[MAX_GENERATION+1];
            gcCountTable = (short[])
                           BootstrapMemory.Allocate(typeof(short[]), tableSize);
            // gcFrequencyTable = new short[MAX_GENERATION+1];
            gcFrequencyTable = (short[])
                               BootstrapMemory.Allocate(typeof(short[]), tableSize);
            // gcPromotedTable = new UIntPtr[MAX_GENERATION+1];
            gcPromotedTable = (UIntPtr[])
                              BootstrapMemory.Allocate(typeof(UIntPtr[]), tableSize);
            // gcPromotedLimitTable = new UIntPtr[MAX_GENERATION+1];
            gcPromotedLimitTable = (UIntPtr[])
                                   BootstrapMemory.Allocate(typeof(UIntPtr[]), tableSize);
            pretenuredSinceLastFullGC = UIntPtr.Zero;
            // fromSpacePageCounts = new int[MAX_GENERATION+1];
            fromSpacePageCounts = (int[])
                                  BootstrapMemory.Allocate(typeof(int[]),
                                                           (uint)MAX_GENERATION + 1);

            MinGenPage = (UIntPtr[])
                         BootstrapMemory.Allocate(typeof(UIntPtr[]),
                                                  (uint)MAX_GENERATION + 1);
            MaxGenPage = (UIntPtr[])
                         BootstrapMemory.Allocate(typeof(UIntPtr[]),
                                                  (uint)MAX_GENERATION + 1);


            // Initialization of tables
            // gcFrequencyTable and gcPromotedLimitTable may be modified by
            // VTable.ParseArgs
            gcFrequencyTable[(int)MIN_GENERATION]     = Int16.MaxValue;
            gcPromotedLimitTable[(int)MIN_GENERATION] = (UIntPtr)1 << 25; // 32MB
            // Install the remembered set
            InstallRemSet();
        }
 public static new void Initialize()
 {
     StopTheWorldCollector.Initialize();
     SegregatedFreeList.Initialize();
     // instance = new MarkSweepCollector();
     MarkSweepCollector.instance = (MarkSweepCollector)
                                   BootstrapMemory.Allocate(typeof(MarkSweepCollector));
     // markReferenceVisitor = new MarkReferenceVisitor();
     markReferenceVisitor = (MarkReferenceVisitor)
                            BootstrapMemory.Allocate(typeof(MarkReferenceVisitor));
     // markAndProcessReferenceVisitor = new MarkAndProcessReferenceVisitor();
     markAndProcessReferenceVisitor = (MarkAndProcessReferenceVisitor)
                                      BootstrapMemory.Allocate(typeof(MarkAndProcessReferenceVisitor));
     // updateReferenceVisitor = new UpdateReferenceVisitor();
     updateReferenceVisitor = (UpdateReferenceVisitor)
                              BootstrapMemory.Allocate(typeof(UpdateReferenceVisitor));
     // threadMarkReferenceVisitor = new ThreadMarkReferenceVisitor();
     threadMarkReferenceVisitor = (ThreadMarkReferenceVisitor)
                                  BootstrapMemory.Allocate(typeof(ThreadMarkReferenceVisitor));
     // sweepVisitor = new SweepVisitor();
     sweepVisitor = (SweepVisitor)
                    BootstrapMemory.Allocate(typeof(SweepVisitor));
     collectionTrigger = (UIntPtr)InitialTrigger;
 }