Browse Source

* -Ch for heapsize added again
* __heapsize contains the heapsize

peter 21 years ago
parent
commit
759c010f6a
4 changed files with 40 additions and 6 deletions
  1. 6 1
      compiler/globals.pas
  2. 12 1
      compiler/options.pas
  3. 9 3
      compiler/pmodules.pas
  4. 13 1
      compiler/scandir.pas

+ 6 - 1
compiler/globals.pas

@@ -231,6 +231,7 @@ interface
        aktsourcecodepage : tcodepagestring;
 
      { Memory sizes }
+       heapsize,
        stacksize    : longint;
 
 {$Ifdef EXTDEBUG}
@@ -2128,7 +2129,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.148  2004-10-25 15:38:41  peter
+  Revision 1.149  2004-10-26 15:11:01  peter
+    * -Ch for heapsize added again
+    * __heapsize contains the heapsize
+
+  Revision 1.148  2004/10/25 15:38:41  peter
     * heap and heapsize removed
     * checkpointer fixes
 

+ 12 - 1
compiler/options.pas

@@ -512,6 +512,13 @@ begin
                      end;
                     'g' :
                       include(initmoduleswitches,cs_create_pic);
+                    'h' :
+                      begin
+                         val(copy(more,j+1,length(more)-j),heapsize,code);
+                         if (code<>0) or (heapsize<1024) then
+                           IllegalPara(opt);
+                         break;
+                      end;
                     'i' :
                       If UnsetBool(More, j) then
                         exclude(initlocalswitches,cs_check_io)
@@ -2107,7 +2114,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.149  2004-10-25 15:38:41  peter
+  Revision 1.150  2004-10-26 15:11:01  peter
+    * -Ch for heapsize added again
+    * __heapsize contains the heapsize
+
+  Revision 1.149  2004/10/25 15:38:41  peter
     * heap and heapsize removed
     * checkpointer fixes
 

+ 9 - 3
compiler/pmodules.pas

@@ -352,12 +352,14 @@ implementation
       end;
 
 
-    procedure insertstacklength;
+    procedure insertmemorysizes;
       begin
         { stacksize can be specified and is now simulated }
         dataSegment.concat(Tai_align.Create(const_align(4)));
         dataSegment.concat(Tai_symbol.Createname_global('__stklen',AT_DATA,4));
         dataSegment.concat(Tai_const.Create_32bit(stacksize));
+        dataSegment.concat(Tai_symbol.Createname_global('__heapsize',AT_DATA,4));
+        dataSegment.concat(Tai_const.Create_32bit(heapsize));
       end;
 
 
@@ -1443,7 +1445,7 @@ implementation
          insertThreadVarTablesTable;
          insertResourceTablesTable;
          insertinitfinaltable;
-         insertstacklength;
+         insertmemorysizes;
 
          { create dwarf debuginfo }
          create_dwarf;
@@ -1506,7 +1508,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.167  2004-10-25 15:38:41  peter
+  Revision 1.168  2004-10-26 15:11:01  peter
+    * -Ch for heapsize added again
+    * __heapsize contains the heapsize
+
+  Revision 1.167  2004/10/25 15:38:41  peter
     * heap and heapsize removed
     * checkpointer fixes
 

+ 13 - 1
compiler/scandir.pas

@@ -549,6 +549,14 @@ implementation
         l:=current_scanner.readval;
         if l>1024 then
           stacksize:=l;
+        if c=',' then
+          begin
+            current_scanner.readchar;
+            current_scanner.skipspace;
+            l:=current_scanner.readval;
+            if l>1024 then
+              heapsize:=l;
+          end;
       end;
 
 
@@ -1130,7 +1138,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.45  2004-10-25 15:38:41  peter
+  Revision 1.46  2004-10-26 15:11:01  peter
+    * -Ch for heapsize added again
+    * __heapsize contains the heapsize
+
+  Revision 1.45  2004/10/25 15:38:41  peter
     * heap and heapsize removed
     * checkpointer fixes