Explorar o código

* heap management corrected (heap_brk)

Tomas Hajny %!s(int64=23) %!d(string=hai) anos
pai
achega
b1c4768775
Modificáronse 1 ficheiros con 13 adicións e 3 borrados
  1. 13 3
      rtl/os2/system.pas

+ 13 - 3
rtl/os2/system.pas

@@ -155,6 +155,7 @@ implementation
 var
 var
     heap_base: pointer; external name '__heap_base';
     heap_base: pointer; external name '__heap_base';
     heap_brk: pointer; external name '__heap_brk';
     heap_brk: pointer; external name '__heap_brk';
+    heap_end: pointer; external name '__heap_end';
 
 
 procedure DosGetInfoBlocks (PATIB: PPThreadInfoBlock;
 procedure DosGetInfoBlocks (PATIB: PPThreadInfoBlock;
                             PAPIB: PPProcessInfoBlock); cdecl;
                             PAPIB: PPProcessInfoBlock); cdecl;
@@ -181,6 +182,12 @@ external 'DOSCALLS' index 226;
 {This is the correct way to call external assembler procedures.}
 {This is the correct way to call external assembler procedures.}
 procedure syscall; external name '___SYSCALL';
 procedure syscall; external name '___SYSCALL';
 
 
+{
+procedure syscall; external 'EMX' index 2;
+
+procedure emx_init; external 'EMX' index 1;
+}
+
 
 
 
 
    { converts an OS/2 error code to a TP compatible error }
    { converts an OS/2 error code to a TP compatible error }
@@ -366,7 +373,7 @@ end ['EAX'];
 
 
 function getheapsize:longint;assembler;
 function getheapsize:longint;assembler;
 asm
 asm
-    movl HeapSize,%eax
+    movl heap_brk,%eax
 end ['EAX'];
 end ['EAX'];
 
 
 {$i heap.inc}
 {$i heap.inc}
@@ -990,7 +997,7 @@ begin
     {Enable the brk area by initializing it with the initial heap size.}
     {Enable the brk area by initializing it with the initial heap size.}
 
 
         mov ax, 7F01h
         mov ax, 7F01h
-        mov edx, HeapSize
+        mov edx, heap_brk
         add edx, heap_base
         add edx, heap_base
         call syscall
         call syscall
         cmp eax, -1
         cmp eax, -1
@@ -1066,7 +1073,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2001-11-15 18:49:43  hajny
+  Revision 1.18  2002-02-10 13:46:20  hajny
+    * heap management corrected (heap_brk)
+
+  Revision 1.17  2001/11/15 18:49:43  hajny
     * DefaultTextLineBreakStyle misplacing corrected
     * DefaultTextLineBreakStyle misplacing corrected
 
 
   Revision 1.16  2001/10/23 21:51:03  peter
   Revision 1.16  2001/10/23 21:51:03  peter