+ allow setting the heap size for the ZX Spectrum target

git-svn-id: branches/z80@45102 -
This commit is contained in:
nickysn 2020-04-26 14:58:47 +00:00
parent 3e38e3acc5
commit caecdfd51d
3 changed files with 7 additions and 6 deletions

View File

@ -1547,7 +1547,7 @@ implementation
tcb.free;
{ allocate an initial heap on embedded systems }
if target_info.system in (systems_embedded+systems_freertos) then
if target_info.system in (systems_embedded+systems_freertos+[system_z80_zxspectrum]) then
begin
{ tai_datablock cannot yet be handled via the high level typed const
builder, because it implies the generation of a symbol, while this

View File

@ -3952,7 +3952,7 @@ begin
end;
{ Set up default value for the heap }
if target_info.system in (systems_embedded+systems_freertos) then
if target_info.system in (systems_embedded+systems_freertos+[system_z80_zxspectrum]) then
begin
case target_info.system of
{$ifdef AVR}

View File

@ -78,6 +78,10 @@ const
sLineBreak = LineEnding;
DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
var
__heapsize: Word;external name '__heapsize';
__fpc_initialheap: array[0..0] of byte;external name '__fpc_initialheap';
{$I system.inc}
{$I tinyheap.inc}
@ -256,12 +260,9 @@ end;
SystemUnit Initialization
*****************************************************************************}
var
ZXHeap: array [0..{1023}255] of Byte;
procedure InitZXHeap;
begin
RegisterTinyHeapBlock_Simple_Prealigned(@ZXHeap[0],SizeOf(ZXHeap));
RegisterTinyHeapBlock_Simple_Prealigned(@__fpc_initialheap,__heapsize);
end;
procedure SysInitStdIO;