mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 05:29:34 +01:00
* make sure that the stack size passed to emxbind is valid (override the value passed using $M if necessary)
git-svn-id: trunk@29573 -
This commit is contained in:
parent
4cced1186d
commit
608b14ab4e
@ -473,6 +473,7 @@ var
|
||||
BaseFilename: TPathStr;
|
||||
RsrcStr : string;
|
||||
OutName: TPathStr;
|
||||
StackSizeKB: cardinal;
|
||||
begin
|
||||
if not(cs_link_nolink in current_settings.globalswitches) then
|
||||
Message1(exec_i_linking,current_module.exefilename);
|
||||
@ -513,6 +514,12 @@ begin
|
||||
{ Is this really required? Not anymore according to my EMX docs }
|
||||
Replace(cmdstr,'$HEAPMB',tostr((1048575) shr 20));
|
||||
{Size of the stack when an EMX program runs in OS/2.}
|
||||
StackSizeKB := (StackSize + 1023) shr 10;
|
||||
(* Ensure a value which might work and is accepted by EMXBIND *)
|
||||
if StackSizeKB < 64 then
|
||||
StackSizeKB := 64
|
||||
else if StackSizeKB > (512 shl 10) then
|
||||
StackSizeKB := 512 shl 10;
|
||||
Replace(cmdstr,'$STACKKB',tostr((stacksize+1023) shr 10));
|
||||
{When an EMX program runs in DOS, the heap and stack share the
|
||||
same memory pool. The heap grows upwards, the stack grows downwards.}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user