@@ -355,6 +355,16 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
355355 if (s -> controls -> hhConfig .collectionThresholdRatio < 1.0 ) {
356356 die ("%s collection-threshold-ratio must be at least 1.0" , atName );
357357 }
358+ } else if (0 == strcmp (arg , "cc-threshold-ratio" )) {
359+ i ++ ;
360+ if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
361+ die ("%s cc-threshold-ratio missing argument." , atName );
362+ }
363+
364+ s -> controls -> hhConfig .ccThresholdRatio = stringToFloat (argv [i ++ ]);
365+ if (s -> controls -> hhConfig .ccThresholdRatio <= 1.0 ) {
366+ die ("%s cc-threshold-ratio must be > 1.0" , atName );
367+ }
358368 } else if (0 == strcmp (arg , "min-collection-size" )) {
359369 i ++ ;
360370 if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
@@ -369,6 +379,17 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
369379 }
370380
371381 s -> controls -> hhConfig .minCCSize = stringToBytes (argv [i ++ ]);
382+ } else if (0 == strcmp (arg , "max-cc-chain-length" )) {
383+ i ++ ;
384+ if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
385+ die ("%s max-cc-chain-length missing argument." , atName );
386+ }
387+
388+ int len = stringToInt (argv [i ++ ]);
389+ if (len <= 0 ) {
390+ die ("%s max-cc-chain-length must be >= 1" , atName );
391+ }
392+ s -> controls -> hhConfig .maxCCChainLength = len ;
372393 } else if (0 == strcmp (arg , "min-collection-depth" )) {
373394 i ++ ;
374395 if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
@@ -380,6 +401,17 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
380401 die ("%s min-collection-depth must be > 0" , atName );
381402 }
382403 s -> controls -> hhConfig .minLocalDepth = minDepth ;
404+ } else if (0 == strcmp (arg , "max-cc-depth" )) {
405+ i ++ ;
406+ if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
407+ die ("%s max-cc-depth missing argument." , atName );
408+ }
409+
410+ int maxd = stringToInt (argv [i ++ ]);
411+ if (maxd < 0 ) {
412+ die ("%s max-cc-depth must be >= 0" , atName );
413+ }
414+ s -> controls -> hhConfig .maxCCDepth = maxd ;
383415 } else if (0 == strcmp (arg , "trace-buffer-size" )) {
384416 i ++ ;
385417 if (i == argc || (0 == strcmp (argv [i ], "--" ))) {
@@ -434,6 +466,9 @@ int GC_init (GC_state s, int argc, char **argv) {
434466 s -> controls -> hhConfig .collectionThresholdRatio = 8.0 ;
435467 s -> controls -> hhConfig .minCollectionSize = 1024L * 1024L ;
436468 s -> controls -> hhConfig .minCCSize = 1024L * 1024L ;
469+ s -> controls -> hhConfig .maxCCChainLength = 2 ;
470+ s -> controls -> hhConfig .ccThresholdRatio = 2.0f ;
471+ s -> controls -> hhConfig .maxCCDepth = 3 ;
437472 s -> controls -> hhConfig .minLocalDepth = 2 ;
438473 s -> controls -> rusageMeasureGC = FALSE;
439474 s -> controls -> summary = FALSE;
0 commit comments