summaryrefslogtreecommitdiff
path: root/rtl/msdos/system.pp
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/msdos/system.pp')
-rw-r--r--rtl/msdos/system.pp14
1 files changed, 10 insertions, 4 deletions
diff --git a/rtl/msdos/system.pp b/rtl/msdos/system.pp
index 6f76b581d1..46d3d697ad 100644
--- a/rtl/msdos/system.pp
+++ b/rtl/msdos/system.pp
@@ -14,6 +14,7 @@ interface
$mode switch is not effective }
{$I systemh.inc}
+{$I tnyheaph.inc}
const
LineEnding = #13#10;
@@ -309,10 +310,16 @@ end;
SystemUnit Initialization
*****************************************************************************}
-procedure InitNearHeap;
+procedure InitDosHeap;
+type
+{$if defined(FPC_X86_DATA_FAR) or defined(FPC_X86_DATA_HUGE)}
+ TPointerArithmeticType = HugePointer;
+{$else}
+ TPointerArithmeticType = Pointer;
+{$endif}
begin
SetMemoryManager(TinyHeapMemoryManager);
- RegisterTinyHeapBlock(__nearheap_start, ptruint(__nearheap_end) - ptruint(__nearheap_start));
+ RegisterTinyHeapBlock_Simple_Prealigned(__nearheap_start, TPointerArithmeticType(__nearheap_end) - TPointerArithmeticType(__nearheap_start));
end;
function CheckLFN:boolean;
@@ -366,7 +373,7 @@ begin
{ To be set if this is a library and not a program }
IsLibrary := FALSE;
{ Setup heap }
- InitNearHeap;
+ InitDosHeap;
SysInitExceptions;
initunicodestringmanager;
{ Setup stdin, stdout and stderr }
@@ -382,5 +389,4 @@ begin
AllFilesMask := '*.*';
{ Reset IO Error }
InOutRes:=0;
- initvariantmanager;
end.