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

Function CCMD

source/common/objects/dobjgc.cpp:841–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

839//==========================================================================
840
841CCMD(gc)
842{
843 if (argv.argc() == 1)
844 {
845 Printf ("Usage: gc stop|now|full|count|pause [size]|stepmul [size]\n");
846 return;
847 }
848 if (stricmp(argv[1], "stop") == 0)
849 {
850 GC::Threshold = ~(size_t)0 - 2;
851 }
852 else if (stricmp(argv[1], "now") == 0)
853 {
854 GC::Threshold = GC::AllocBytes;
855 }
856 else if (stricmp(argv[1], "full") == 0)
857 {
858 GC::FullGC();
859 }
860 else if (stricmp(argv[1], "count") == 0)
861 {
862 int cnt = 0;
863 for (DObject *obj = GC::Root; obj; obj = obj->ObjNext, cnt++);
864 Printf("%d active objects counted\n", cnt);
865 }
866 else if (stricmp(argv[1], "pause") == 0)
867 {
868 if (argv.argc() == 2)
869 {
870 Printf ("Current GC pause is %d\n", GC::Pause);
871 }
872 else
873 {
874 GC::Pause = max(1,atoi(argv[2]));
875 }
876 }
877 else if (stricmp(argv[1], "stepmul") == 0)
878 {
879 if (argv.argc() == 2)
880 {
881 Printf ("Current GC stepmul is %d\n", GC::StepMul);
882 }
883 else
884 {
885 GC::StepMul = max(100, atoi(argv[2]));
886 }
887 }
888}
889

Callers

nothing calls this directly

Calls 4

PrintfFunction · 0.85
stricmpFunction · 0.85
FullGCFunction · 0.85
argcMethod · 0.80

Tested by

no test coverage detected