Explorar el Código

Merged revisions 12648-12650 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r12648 | florian | 2009-02-01 19:22:18 +0100 (Sun, 01 Feb 2009) | 1 line

* internal coff linker takes care of min./max. stack size as well as pe flags
........
r12649 | florian | 2009-02-01 19:29:58 +0100 (Sun, 01 Feb 2009) | 2 lines

* set stacksize in the main program, it makes no sense to set it in fpcdefs.inc and parse it a zillion times
* use maxstacksize to set stacksize on windows
........
r12650 | florian | 2009-02-01 20:21:10 +0100 (Sun, 01 Feb 2009) | 1 line

* limit IDE stack to 3M on windows to avoid trouble at IDE startup at least on XP x64
........

git-svn-id: branches/fixes_2_2@12669 -

joost hace 16 años
padre
commit
c10b239b95
Se han modificado 4 ficheros con 27 adiciones y 18 borrados
  1. 0 15
      compiler/fpcdefs.inc
  2. 7 1
      compiler/ogcoff.pas
  3. 15 0
      compiler/pp.pas
  4. 5 2
      ide/fp.pas

+ 0 - 15
compiler/fpcdefs.inc

@@ -4,21 +4,6 @@
 {$goto on}
 {$inline on}
 
-{$ifdef win32}
-  { 256 MB stack }
-  { under windows the stack can't grow }
-  {$MEMORY 256000000}
-{$else win32}
-  {$ifdef win64}
-    { 512 MB stack }
-    { under windows the stack can't grow }
-    {$MEMORY 512000000}
-  {$else win64}
-    { 1 MB stack }
-    {$MEMORY 1000000}
-  {$endif win64}
-{$endif win32}
-
 { This reduces the memory requirements a lot }
 {$PACKENUM 1}
 {$ifdef FPC_HAS_VARSETS}

+ 7 - 1
compiler/ogcoff.pas

@@ -2238,6 +2238,12 @@ const pemagic : array[0..3] of byte = (
             peoptheader.DllCharacteristics:=0;
             peoptheader.SizeOfStackReserve:=stacksize;
             peoptheader.SizeOfStackCommit:=$1000;
+            if MinStackSizeSetExplicity then
+              peoptheader.SizeOfStackCommit:=minstacksize;
+            if MaxStackSizeSetExplicity then
+              peoptheader.SizeOfStackReserve:=maxstacksize;
+            if SetPEFlagsSetExplicity then
+              peoptheader.LoaderFlags:=peflags;
             peoptheader.SizeOfHeapReserve:=$100000;
             peoptheader.SizeOfHeapCommit:=$1000;
             peoptheader.NumberOfRvaAndSizes:=PE_DATADIR_ENTRIES;
@@ -2261,7 +2267,7 @@ const pemagic : array[0..3] of byte = (
             djoptheader.entry:=EntrySym.offset;
             FWriter.write(djoptheader,sizeof(djoptheader));
           end;
-          
+
         { For some unknown reason WM 6.1 requires .idata section to be read only.
           Otherwise it refuses to load DLLs greater than 64KB.
           Earlier versions of WinCE load DLLs regardless of .idata flags. }

+ 15 - 0
compiler/pp.pas

@@ -143,6 +143,21 @@ program pp;
   {$endif i386}
 {$endif support_mmx}
 
+{$ifdef win32}
+  { 256 MB stack }
+  { under windows the stack can't grow }
+  {$MAXSTACKSIZE 256000000}
+{$else win32}
+  {$ifdef win64}
+    { 512 MB stack }
+    { under windows the stack can't grow }
+    {$MAXSTACKSIZE 512000000}
+  {$else win64}
+    { 1 MB stack }
+    {$STACKSIZE 1000000}
+  {$endif win64}
+{$endif win32}
+
 uses
 {$ifdef cmem}
   cmem,

+ 5 - 2
ide/fp.pas

@@ -14,12 +14,15 @@
  **********************************************************************}
 program FP;
 
-{$ifdef IncRes}
 {$ifdef Windows}
+{ some windows versions, namely at least XP x64 don't like if the IDE stack
+  is too big }
+{$maxstacksize 3000000}
+{$ifdef IncRes}
 {$R fpw32t.rc}
 {$R fpw32ico.rc}
-{$endif Windows}
 {$endif IncRes}
+{$endif Windows}
 
 {$I globdir.inc}
 (**********************************************************************)