[svn] r5937: nemerle/trunk/ncc/main.n

malekith svnadmin at nemerle.org
Tue Nov 15 11:07:27 CET 2005


Log:
Add -stack-size option.

Author: malekith
Date: Tue Nov 15 11:07:27 2005
New Revision: 5937

Modified:
   nemerle/trunk/ncc/main.n

Modified: nemerle/trunk/ncc/main.n
==============================================================================
--- nemerle/trunk/ncc/main.n	(original)
+++ nemerle/trunk/ncc/main.n	Tue Nov 15 11:07:27 2005
@@ -52,10 +52,14 @@
 {
   module MainClass
   {
+    mutable stack_megs : int = 0;
+    
     public Main () : void
     {
-      if (needs_bigger_stack ()) {
-        def thread = System.Threading.Thread (main_with_catching, 64 * 1024 * 1024);
+      if (stack_megs != 0 || needs_bigger_stack ()) {
+        when (stack_megs == 0)
+          stack_megs = 64;
+        def thread = System.Threading.Thread (main_with_catching, stack_megs * 1024 * 1024);
         thread.Start ();
         thread.Join ();
       } else
@@ -122,6 +126,10 @@
       };
 
       def opts = Options.GetCommonOptions () + [
+        Getopt.CliOption.Int (name = "-stack-size",
+                     aliases = [],
+                     help = "Set stack size of the compiler to INT megabytes",
+                     handler = fun (k) { stack_megs = k; }),
         Getopt.CliOption.Flag (name = "-version",
                      aliases = ["-V"],
                      help = "Output version information and exit",



More information about the svn mailing list