浏览代码

- don't create a heap segment for win16

git-svn-id: trunk@42658 -
nickysn 6 年之前
父节点
当前提交
24e3d95fe0
共有 2 个文件被更改,包括 6 次插入10 次删除
  1. 3 2
      compiler/i8086/n8086util.pas
  2. 3 8
      compiler/ogomf.pas

+ 3 - 2
compiler/i8086/n8086util.pas

@@ -42,7 +42,7 @@ implementation
 
   uses
     sysutils,cutils,
-    globtype,globals,cpuinfo,
+    globtype,globals,cpuinfo,systems,
     aasmbase,aasmdata,aasmtai,
     symdef;
 
@@ -52,7 +52,8 @@ implementation
       inherited;
       if current_settings.x86memorymodel<>mm_tiny then
         InsertStackSegment;
-      InsertHeapSegment;
+      if target_info.system<>system_i8086_win16 then
+        InsertHeapSegment;
       if current_settings.x86memorymodel in x86_near_data_models then
         InsertStackPlusHeapSize;
     end;

+ 3 - 8
compiler/ogomf.pas

@@ -642,7 +642,6 @@ interface
       private
         FEarlySize: QWord;
         FStackSize: QWord;
-        FLocalHeapSize: QWord;
         FExeMetaSec: TNewExeMetaSection;
         FMemBasePos: Word;
         FDataPosSectors: Word;
@@ -655,7 +654,6 @@ interface
         function CanAddObjSection(objsec:TObjSection;ExeSectionLimit:QWord):boolean;
         property EarlySize: QWord read FEarlySize write FEarlySize;
         property StackSize: QWord read FStackSize write FStackSize;
-        property LocalHeapSize: QWord read FLocalHeapSize write FLocalHeapSize;
         property ExeMetaSec: TNewExeMetaSection read FExeMetaSec write FExeMetaSec;
         property MemBasePos: Word read FMemBasePos write FMemBasePos;
         property DataPosSectors: Word read FDataPosSectors write FDataPosSectors;
@@ -4184,7 +4182,7 @@ cleanup:
         s: TSymStr;
         Separator: SizeInt;
         SegName, SegClass: string;
-        IsStack, IsHeap: Boolean;
+        IsStack: Boolean;
       begin
         { allow mixing initialized and uninitialized data in the same section
           => set ignoreprops=true }
@@ -4212,9 +4210,6 @@ cleanup:
           IsStack:=True;
         if IsStack then
           StackSize:=StackSize+objsec.Size;
-        IsHeap:=SegClass='HEAP';
-        if IsHeap then
-          LocalHeapSize:=LocalHeapSize+objsec.Size;
         EarlySize:=align_qword(EarlySize,SecAlign)+objsec.Size;
       end;
 
@@ -4323,8 +4318,8 @@ cleanup:
         Header.InitialSP:=0;
         Header.InitialSS:=Header.AutoDataSegmentNumber;
         Header.InitialStackSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).StackSize;
-        Header.InitialLocalHeapSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).LocalHeapSize;
-        {todo: subtract the stack size and the local heap size from the size of the auto data segment }
+        Header.InitialLocalHeapSize:=heapsize;
+        {todo: subtract the stack size from the size of the auto data segment }
 
         Header.SegmentTableStart:=NewExeHeaderSize;
         Header.SegmentTableEntriesCount:=ExeSectionList.Count;