Procházet zdrojové kódy

Set the end of the stack for the main thread

This helps the GC by minimizing the stack area to scan, while at the
same time reducing the chance of false positives when scanning the stack
for managed objects since we know no managed object can live on the
stack above the main function. This improves memory usage for the test
case in #2619 quite much (but that particular bug isn't fixed by this).
Rolf Bjarne Kvinge před 14 roky
rodič
revize
72b8bf6402
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      mono/mini/driver.c

+ 4 - 0
mono/mini/driver.c

@@ -1811,6 +1811,10 @@ mono_main (int argc, char* argv[])
 	mono_set_defaults (mini_verbose, opt);
 	domain = mini_init (argv [i], forced_version);
 
+#ifdef HAVE_SGEN_GC
+	mono_gc_set_stack_end (&domain);
+#endif
+
 	if (agents) {
 		int i;