mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 08:39:27 +01:00
sinclairql: initial heap allocation code, and minor system unit bits
git-svn-id: trunk@47351 -
This commit is contained in:
parent
b90d6e1114
commit
d5596ef21d
@ -18,12 +18,15 @@
|
|||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function SysOSAlloc(size: ptruint): pointer;
|
function SysOSAlloc(size: ptruint): pointer;
|
||||||
begin
|
begin
|
||||||
|
Result:=mt_alchp(size, nil, -1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$define HAS_SYSOSFREE}
|
{$define HAS_SYSOSFREE}
|
||||||
|
|
||||||
procedure SysOSFree(p: pointer; size: ptruint);
|
procedure SysOSFree(p: pointer; size: ptruint);
|
||||||
begin
|
begin
|
||||||
|
mt_rechp(p);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
|
{$i qdos.inc}
|
||||||
|
|
||||||
procedure Error2InOutRes(errno: longint);
|
procedure Error2InOutRes(errno: longint);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -122,8 +122,12 @@ var
|
|||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
System Dependent Exit code
|
System Dependent Exit code
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
|
procedure haltproc(e:longint); external name '_haltproc';
|
||||||
|
|
||||||
procedure system_exit;
|
procedure system_exit;
|
||||||
begin
|
begin
|
||||||
|
haltproc(exitcode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
@ -146,6 +150,19 @@ begin
|
|||||||
CheckInitialStkLen := StkLen;
|
CheckInitialStkLen := StkLen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure PrintStr(const s: shortstring);
|
||||||
|
begin
|
||||||
|
io_sstrg($00010001,-1,@s[1],ord(s[0]));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure PrintStr2(const s: shortstring);
|
||||||
|
var
|
||||||
|
i: smallint;
|
||||||
|
begin
|
||||||
|
for i:=1 to ord(s[0]) do
|
||||||
|
io_sbyte($00010001,-1,s[i]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StackLength := CheckInitialStkLen (InitialStkLen);
|
StackLength := CheckInitialStkLen (InitialStkLen);
|
||||||
@ -160,7 +177,7 @@ begin
|
|||||||
InitUnicodeStringManager;
|
InitUnicodeStringManager;
|
||||||
{$endif FPC_HAS_FEATURE_UNICODESTRINGS}
|
{$endif FPC_HAS_FEATURE_UNICODESTRINGS}
|
||||||
{ Setup stdin, stdout and stderr }
|
{ Setup stdin, stdout and stderr }
|
||||||
SysInitStdIO;
|
(* SysInitStdIO;*)
|
||||||
{ Reset IO Error }
|
{ Reset IO Error }
|
||||||
InOutRes:=0;
|
InOutRes:=0;
|
||||||
{ Setup command line arguments }
|
{ Setup command line arguments }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user