Selaa lähdekoodia

fixed go32v2 compile

peter 21 vuotta sitten
vanhempi
commit
244b6d1435
6 muutettua tiedostoa jossa 32 lisäystä ja 35 poistoa
  1. 6 4
      rtl/go32v2/system.pp
  2. 9 2
      rtl/go32v2/vesa.inc
  3. 4 8
      rtl/inc/heaph.inc
  4. 4 11
      rtl/inc/heaptrc.pp
  5. 4 7
      rtl/inc/objects.pp
  6. 5 3
      rtl/win32/system.pp

+ 6 - 4
rtl/go32v2/system.pp

@@ -932,7 +932,7 @@ asm
 end;
 
 {*****************************************************************************
-      OS Memory allocation / deallocation 
+      OS Memory allocation / deallocation
  ****************************************************************************}
 
 function SysOSAlloc(size: ptrint): pointer;
@@ -940,11 +940,10 @@ begin
   result := sbrk(size);
 end;
 
-{$define HAS_SYSOSFREE}
+{.$define HAS_SYSOSFREE}
 
 procedure SysOSFree(p: pointer; size: ptrint);
 begin
-  fpmunmap(p, size);
 end;
 
 
@@ -1623,7 +1622,10 @@ Begin
 End.
 {
   $Log$
-  Revision 1.36  2004-06-17 16:16:13  peter
+  Revision 1.37  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.36  2004/06/17 16:16:13  peter
     * New heapmanager that releases memory back to the OS, donated
       by Micha Nelissen
 

+ 9 - 2
rtl/go32v2/vesa.inc

@@ -1924,6 +1924,9 @@ end;
 
    end;
 {$ENDIF}
+
+
+(*
 type
   heaperrorproc=function(size:longint):integer;
 
@@ -1963,6 +1966,7 @@ Const
       HeapError:=OldHeapError;
       HeapErrorIsHooked:=false;
     end;
+*)
 
   function SetupLinear(var ModeInfo: TVESAModeInfo;mode : word) : boolean;
    begin
@@ -2023,7 +2027,7 @@ Const
        end;
      if UseNoSelector then
        begin
-         HookHeapError;
+{         HookHeapError; }
          LFBPointer:=pointer(FrameBufferLinearAddress-get_segment_base_address(get_ds));
          if dword(LFBPointer)+dword(VESAInfo.TotalMem shl 16)-1 > dword(get_segment_limit(get_ds)) then
            set_segment_limit(get_ds,dword(LFBPointer)+dword(VESAInfo.TotalMem shl 16)-1);
@@ -2733,7 +2737,10 @@ Const
 
 {
   $Log$
-  Revision 1.9  2002-09-07 16:01:19  peter
+  Revision 1.10  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.9  2002/09/07 16:01:19  peter
     * old logs removed and tabs fixed
 
 }

+ 4 - 8
rtl/inc/heaph.inc

@@ -45,13 +45,6 @@ const
   growheapsizesmall : ptrint=32*1024; { fixed-size small blocks will grow with 32k }
   growheapsize1 : ptrint=256*1024;  { < 256k will grow with 256k }
   growheapsize2 : ptrint=1024*1024; { > 256k will grow with 1m }
-  ReturnNilIfGrowHeapFails : boolean = false;
-
-{ the following variable is needed for heaptrc/win32 }
-{$ifdef WIN32}  
-var
-  HeapOrg: pointer;
-{$endif}  
 
 { Default MemoryManager functions }
 Function  SysGetmem(Size:ptrint):Pointer;
@@ -100,7 +93,10 @@ Procedure AsmFreemem(var p:pointer);
 
 {
   $Log$
-  Revision 1.9  2004-06-17 16:16:13  peter
+  Revision 1.10  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.9  2004/06/17 16:16:13  peter
     * New heapmanager that releases memory back to the OS, donated
       by Micha Nelissen
 

+ 4 - 11
rtl/inc/heaptrc.pp

@@ -716,7 +716,6 @@ var
    __stklen : longword;external name '__stklen';
    __stkbottom : longword;external name '__stkbottom';
    edata : longword; external name 'edata';
-   heap_at_init : pointer;
 {$endif go32v2}
 
 {$ifdef win32}
@@ -754,9 +753,6 @@ begin
   { allow all between start of code and end of data }
   if ptruint(p)<=data_end then
     goto _exit;
-  { .bss section }
-  if ptruint(p)<=ptruint(heap_at_init) then
-    goto _exit;
   { stack can be above heap !! }
 
   if (ptruint(p)>=get_ebp) and (ptruint(p)<=stack_top) then
@@ -765,8 +761,6 @@ begin
 
   { I don't know where the stack is in other OS !! }
 {$ifdef win32}
-  if (ptruint(p)>=$40000) and (p<=HeapOrg) then
-    goto _exit;
   { inside stack ? }
   asm
      movl %ebp,get_ebp
@@ -1014,10 +1008,6 @@ begin
   Assign(error_file,'heap.err');
   Rewrite(error_file);
 {$endif EXTRA}
-  { checkpointer init }
-{$ifdef go32v2}
-  Heap_at_init:=HeapPtr;
-{$endif}
 end;
 
 
@@ -1152,7 +1142,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.30  2004-06-17 16:16:13  peter
+  Revision 1.31  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.30  2004/06/17 16:16:13  peter
     * New heapmanager that releases memory back to the OS, donated
       by Micha Nelissen
 

+ 4 - 7
rtl/inc/objects.pp

@@ -1798,10 +1798,7 @@ BEGIN
          GetMem(P, Li);                               { Allocate memory }
          FillChar(P^, Li, #0);                        { Clear the memory }
        End Else Begin
-         OldVal:=ReturnNilIfGrowHeapFails;
-         ReturnNilIfGrowHeapFails:=true;
          GetMem(P,Li);
-         ReturnNilIfGrowHeapFails:=OldVal;
          If P = Nil Then Exit;
          FillChar(P^, Li, #0);                        { Clear the memory }
        End;                           { Insufficient memory }
@@ -1816,10 +1813,7 @@ BEGIN
      If (P <> Nil) AND (ALimit > BlkCount) Then Begin { Expand stream size }
        For W := BlkCount To ALimit-1 Do Begin
          If (MaxAvail < BlkSize) Then Begin           { Check enough memory }
-           OldVal:=ReturnNilIfGrowHeapFails;
-           ReturnNilIfGrowHeapFails:=true;
            GetMem(P^[W],BlkSize);
-           ReturnNilIfGrowHeapFails:=OldVal;
            If P = Nil Then Begin
              For I := BlkCount To W-1 Do
                FreeMem(P^[I], BlkSize);                 { Free mem allocated }
@@ -2950,7 +2944,10 @@ BEGIN
 END.
 {
   $Log$
-  Revision 1.31  2004-04-28 20:48:20  peter
+  Revision 1.32  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.31  2004/04/28 20:48:20  peter
     * ordinal-pointer conversions fixed
 
   Revision 1.30  2004/04/22 20:59:23  peter

+ 5 - 3
rtl/win32/system.pp

@@ -282,7 +282,7 @@ asm
 end ['EAX'];
 
 {*****************************************************************************
-      OS Memory allocation / deallocation 
+      OS Memory allocation / deallocation
  ****************************************************************************}
 
 function SysOSAlloc(size: ptrint): pointer;
@@ -1603,7 +1603,6 @@ begin
   MainInstance:=HInstance;
   cmdshow:=startupinfo.wshowwindow;
   { Setup heap }
-  HeapOrg:=GetHeapStart;
   InitHeap;
   SysInitExceptions;
   SysInitStdIO;
@@ -1622,7 +1621,10 @@ end.
 
 {
   $Log$
-  Revision 1.57  2004-06-17 16:16:14  peter
+  Revision 1.58  2004-06-20 09:24:40  peter
+  fixed go32v2 compile
+
+  Revision 1.57  2004/06/17 16:16:14  peter
     * New heapmanager that releases memory back to the OS, donated
       by Micha Nelissen