Commit 20c39070 authored by John van Groningen's avatar John van Groningen

add setting the stack and heap size in the project for the generated executable,

(written by Mart Lubbers)
parent 1dc036d5
......@@ -43,6 +43,8 @@ from System.FilePath import :: FilePath
| GenericFusionOff
| DescExLOn
| DescExLOff
| HeapSize !Int
| StackSize !Int
:: ModuleAction
= CreateModule ModuleType
......
......@@ -159,6 +159,10 @@ where
= PR_SetApplicationOptions {PR_GetApplicationOptions project & desc_exl = True} project
set_project_option DescExLOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & desc_exl = False} project
set_project_option (HeapSize hs) project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & hs = hs} project
set_project_option (StackSize ss) project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & hs = ss} project
doProjectAction _ _ _ _ world =
help "cpm project <projectfile> <action>"
......
......@@ -91,11 +91,38 @@ parse_Project_options ["-descexl":project_option_args]
parse_Project_options ["-ndescexl":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok,[DescExLOff:project_options]);
parse_Project_options ["-h",heap_size:project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
# heap_size = parseByteSuffix heap_size;
| heap_size > 0
= (ok,[HeapSize heap_size:project_options]);
parse_Project_options ["-s",stack_size:project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
# stack_size = parseByteSuffix stack_size;
| stack_size > 0
= (ok,[StackSize stack_size:project_options]);
parse_Project_options []
= (True,[]);
parse_Project_options _
= (False,[]);
parseByteSuffix :: !String -> Int;
parseByteSuffix s
| size s == 0
= 0;
# suffix = s.[dec (size s)];
| suffix == 'k' || suffix == 'K'
= 1024 * safeToInt (s % (0, size s - 2));
| suffix == 'm' || suffix == 'M'
= 1024 * 1024 * safeToInt (s % (0, size s - 2));
= safeToInt s;
safeToInt :: !String -> Int;
safeToInt s
| only_digits_in_string 0 s
= toInt s;
= 0;
parse_Module :: ![String] !String -> CpmAction;
parse_Module ["create"] module_name = Module module_name (CreateModule LibraryModule);
parse_Module ["create","application"] module_name = Module module_name (CreateModule ApplicationModule);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment