summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-09 04:35:54 +0000
committerkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-09 04:35:54 +0000
commit312f99e228e9337c1e8fdff6271fd8a827f014c7 (patch)
tree26d882cdd03082211d45d9497eba5a8785535000
parent5119192e2e28a273d49b6993e27ad34debae482a (diff)
downloadfpc-312f99e228e9337c1e8fdff6271fd8a827f014c7.tar.gz
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: https://svn.freepascal.org/svn/fpc/trunk@49150 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--rtl/sinclairql/system.pp38
1 files changed, 13 insertions, 25 deletions
diff --git a/rtl/sinclairql/system.pp b/rtl/sinclairql/system.pp
index 97cc15fc51..0dccad2673 100644
--- a/rtl/sinclairql/system.pp
+++ b/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;