From ace28a35523b1115d5c04323993073058740f4ea Mon Sep 17 00:00:00 2001 From: nickysn Date: Thu, 7 Aug 2014 22:00:24 +0000 Subject: [PATCH] * InitNearHeap procedure renamed InitDosHeap and added support for a huge heap. Startup code still needs to be updated in order to enable >64kb heap. git-svn-id: trunk@28334 - --- rtl/msdos/system.pp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rtl/msdos/system.pp b/rtl/msdos/system.pp index 6f76b581d1..b7cc338fe5 100644 --- a/rtl/msdos/system.pp +++ b/rtl/msdos/system.pp @@ -309,10 +309,16 @@ end; SystemUnit Initialization *****************************************************************************} -procedure InitNearHeap; +procedure InitDosHeap; +type +{$if defined(FPC_X86_FAR_DATA) or defined(FPC_X86_HUGE_DATA)} + TPointerArithmeticType = HugePointer; +{$else} + TPointerArithmeticType = Pointer; +{$endif} begin SetMemoryManager(TinyHeapMemoryManager); - RegisterTinyHeapBlock(__nearheap_start, ptruint(__nearheap_end) - ptruint(__nearheap_start)); + RegisterTinyHeapBlock(__nearheap_start, TPointerArithmeticType(__nearheap_end) - TPointerArithmeticType(__nearheap_start)); end; function CheckLFN:boolean; @@ -366,7 +372,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 }