Просмотр исходного кода

Allow ENABLE_PARTIAL_GC to be disabled

Curtis Man 7 лет назад
Родитель
Сommit
1ee07df0a4
2 измененных файлов с 7 добавлено и 1 удалено
  1. 5 1
      lib/Common/Memory/Recycler.cpp
  2. 2 0
      lib/Common/Memory/SmallNormalHeapBucket.cpp

+ 5 - 1
lib/Common/Memory/Recycler.cpp

@@ -6425,7 +6425,11 @@ Recycler::DoTwoPassConcurrentSweepPreCheck()
         //         SLIST during concurrent sweep.
         //      2. We are not in a Partial GC.
         //      3. At-least one heap bucket exceeds the RecyclerHeuristic::AllocDuringConcurrentSweepHeapBlockThreshold.
-        this->allowAllocationsDuringConcurrentSweepForCollection = this->isInScript && !this->recyclerSweepManager->InPartialCollect();
+        bool inPartialCollect = false;
+#if ENABLE_PARTIAL_GC
+        inPartialCollect = this->recyclerSweepManager->InPartialCollect();
+#endif
+        this->allowAllocationsDuringConcurrentSweepForCollection = this->isInScript && !inPartialCollect;
 
         // Do the actual 2-pass check only if the first 2 checks pass.
         if (this->allowAllocationsDuringConcurrentSweepForCollection)

+ 2 - 0
lib/Common/Memory/SmallNormalHeapBucket.cpp

@@ -23,12 +23,14 @@ SmallNormalHeapBucketBase<TBlockType>::AggregateBucketStats()
 {
     __super::AggregateBucketStats();
 
+#if ENABLE_PARTIAL_GC
     HeapBlockList::ForEach(partialHeapBlockList, [this](TBlockType* heapBlock) {
         heapBlock->AggregateBlockStats(this->memStats);
     });
     HeapBlockList::ForEach(partialSweptHeapBlockList, [this](TBlockType* heapBlock) {
         heapBlock->AggregateBlockStats(this->memStats);
     });
+#endif
 }
 #endif