MCPcopy Create free account
hub / github.com/ZDoom/Raze / SingleStep

Function SingleStep

source/common/objects/dobjgc.cpp:451–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449//==========================================================================
450
451static size_t SingleStep()
452{
453 switch (State)
454 {
455 case GCS_Pause:
456 MarkRoot(); // Start a new collection
457 return 0;
458
459 case GCS_Propagate:
460 if (Gray != nullptr)
461 {
462 return PropagateMark();
463 }
464 else
465 { // no more gray objects
466 Atomic(); // finish mark phase
467 return 0;
468 }
469
470 case GCS_Sweep: {
471 RunningDeallocBytes = 0;
472 size_t swept = SweepObjects(GCSWEEPGRANULARITY);
473 Estimate -= RunningDeallocBytes;
474 if (*SweepPos == nullptr)
475 { // Nothing more to sweep?
476 SweepDone();
477 }
478 return swept;
479 }
480
481 case GCS_Destroy: {
482 size_t destroy_size;
483 destroy_size = DestroyObjects(GCSWEEPGRANULARITY);
484 Estimate -= destroy_size;
485 if (ToDestroy == nullptr)
486 { // Nothing more to destroy?
487 State = GCS_Done;
488 }
489 return destroy_size;
490 }
491
492 case GCS_Done:
493 State = GCS_Pause; // end collection
494 SetThreshold();
495 return 0;
496
497 default:
498 assert(0);
499 return 0;
500 }
501}
502
503//==========================================================================
504//

Callers 2

StepFunction · 0.85
FullGCFunction · 0.85

Calls 7

MarkRootFunction · 0.85
PropagateMarkFunction · 0.85
AtomicFunction · 0.85
SweepObjectsFunction · 0.85
SweepDoneFunction · 0.85
DestroyObjectsFunction · 0.85
SetThresholdFunction · 0.85

Tested by

no test coverage detected