فهرست منبع

sinclairql: instead of tinyheap, made the QL port to use the new OS heap by default, also implemented Randomize, based on patch by Norman Dunbar

git-svn-id: trunk@49150 -
Károly Balogh 4 سال پیش
والد
کامیت
ca475537e8
1فایلهای تغییر یافته به همراه13 افزوده شده و 25 حذف شده
  1. 13 25
      rtl/sinclairql/system.pp

+ 13 - 25
rtl/sinclairql/system.pp

@@ -19,16 +19,13 @@ interface
 {$define FPC_IS_SYSTEM}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_ANSI_TEXTFILEREC}
-{$define FPC_QL_USE_TINYHEAP}
+{$define FPC_QL_USE_OSHEAP}
 
-{$ifdef FPC_QL_USE_TINYHEAP}
+{$ifdef FPC_QL_USE_OSHEAP}
 {$define HAS_MEMORYMANAGER}
-{$endif FPC_QL_USE_TINYHEAP}
+{$endif FPC_QL_USE_OSHEAP}
 
 {$i systemh.inc}
-{$ifdef FPC_QL_USE_TINYHEAP}
-{$i tnyheaph.inc}
-{$endif FPC_QL_USE_TINYHEAP}
 
 {Platform specific information}
 const
@@ -99,9 +96,9 @@ implementation
   {$endif defined(FPUSOFT)}
 
   {$i system.inc}
-  {$ifdef FPC_QL_USE_TINYHEAP}
-  {$i tinyheap.inc}
-  {$endif FPC_QL_USE_TINYHEAP}
+  {$ifdef FPC_QL_USE_OSHEAP}
+  {$i osheap.inc}
+  {$endif FPC_QL_USE_OSHEAP}
 
 
 function GetProcessID:SizeUInt;
@@ -152,13 +149,13 @@ begin
          args[i]:=#0;
        end;
      inc(i);
-   end;    
+   end;
 end;
 
 procedure randomize;
 begin
-  {$WARNING: randseed is uninitialized}
-  randseed:=0;
+  { Get the current date/time }
+  randseed:=mt_rclck;
 end;
 
 procedure PrintStr(ch: longint; const s: shortstring);
@@ -174,15 +171,6 @@ begin
   for i:=0 to 10000 do begin end;
 end;
 
-{$ifdef FPC_QL_USE_TINYHEAP}
-procedure InitQLHeap;
-begin
-  HeapOrg:=nil;
-  HeapEnd:=nil;
-  FreeList:=nil;
-  HeapPtr:=nil;
-end;
-{$endif}
 
 {*****************************************************************************
                         System Dependent Entry code
@@ -250,12 +238,12 @@ begin
 { Initialize ExitProc }
   ExitProc:=Nil;
   SysInitQDOS;
-{$ifndef FPC_QL_USE_TINYHEAP}
+{$ifndef FPC_QL_USE_OSHEAP}
 { Setup heap }
   InitHeap;
-{$else FPC_QL_USE_TINYHEAP}
-  InitQLHeap;
-{$endif FPC_QL_USE_TINYHEAP}
+{$else FPC_QL_USE_OSHEAP}
+//  InitOSHeap;
+{$endif FPC_QL_USE_OSHEAP}
   SysInitExceptions;
 {$ifdef FPC_HAS_FEATURE_UNICODESTRINGS}
   InitUnicodeStringManager;