Browse Source

* use RegisterTinyHeapBlock_Simple_Prealigned in the msdos rtl

git-svn-id: trunk@28652 -
nickysn 11 years ago
parent
commit
8edfd33af8
2 changed files with 7 additions and 5 deletions
  1. 6 4
      rtl/msdos/prt0comn.asm
  2. 1 1
      rtl/msdos/system.pp

+ 6 - 4
rtl/msdos/prt0comn.asm

@@ -203,13 +203,15 @@ skip_mem_realloc:
         and bl, 0FEh
         mov word [__stkbottom], bx
 
-        cmp bx, _end wrt dgroup
+        mov ax, _end wrt dgroup
+        cmp bx, ax
         jb not_enough_mem
 
         ; heap is between [ds:_end wrt dgroup] and [ds:__stkbottom - 1]
-        mov word [__nearheap_start], _end wrt dgroup
-        mov bx, word [__stkbottom]
-        dec bx
+        add ax, 3
+        and al, 0FCh
+        mov word [__nearheap_start], ax
+        and bl, 0FCh
         mov word [__nearheap_end], bx
 
 ; ****************************************************************************

+ 1 - 1
rtl/msdos/system.pp

@@ -319,7 +319,7 @@ type
 {$endif}
 begin
   SetMemoryManager(TinyHeapMemoryManager);
-  RegisterTinyHeapBlock_Simple(__nearheap_start, TPointerArithmeticType(__nearheap_end) - TPointerArithmeticType(__nearheap_start));
+  RegisterTinyHeapBlock_Simple_Prealigned(__nearheap_start, TPointerArithmeticType(__nearheap_end) - TPointerArithmeticType(__nearheap_start));
 end;
 
 function CheckLFN:boolean;