mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 09:46:12 +02:00
+ WebAssembly: allow specifying heapsize and maxheapsize larger than 2GiB
(WebAssembly has a 32-bit address space, so there's still a 4GiB limit)
This commit is contained in:
parent
7fc6d5aaa1
commit
184c612f78
@ -417,7 +417,7 @@ Const
|
|||||||
pendingstate : tpendingstate;
|
pendingstate : tpendingstate;
|
||||||
{ Memory sizes }
|
{ Memory sizes }
|
||||||
heapsize,
|
heapsize,
|
||||||
maxheapsize,
|
maxheapsize : int64;
|
||||||
stacksize : longint;
|
stacksize : longint;
|
||||||
|
|
||||||
{$Ifdef EXTDEBUG}
|
{$Ifdef EXTDEBUG}
|
||||||
|
@ -855,9 +855,9 @@ unit scandir;
|
|||||||
|
|
||||||
procedure dir_memory;
|
procedure dir_memory;
|
||||||
var
|
var
|
||||||
l : longint;
|
l : int64;
|
||||||
heapsize_limit: longint;
|
heapsize_limit: int64;
|
||||||
maxheapsize_limit: longint;
|
maxheapsize_limit: int64;
|
||||||
begin
|
begin
|
||||||
{$if defined(i8086)}
|
{$if defined(i8086)}
|
||||||
if target_info.system=system_i8086_win16 then
|
if target_info.system=system_i8086_win16 then
|
||||||
@ -875,12 +875,15 @@ unit scandir;
|
|||||||
heapsize_limit:=65520;
|
heapsize_limit:=65520;
|
||||||
maxheapsize_limit:=65520;
|
maxheapsize_limit:=65520;
|
||||||
end;
|
end;
|
||||||
|
{$elseif defined(WASM32)}
|
||||||
|
heapsize_limit:=int64(high(uint32))+1;
|
||||||
|
maxheapsize_limit:=int64(high(uint32))+1;
|
||||||
{$elseif defined(cpu16bitaddr)}
|
{$elseif defined(cpu16bitaddr)}
|
||||||
heapsize_limit:=65520;
|
heapsize_limit:=65520;
|
||||||
maxheapsize_limit:=65520;
|
maxheapsize_limit:=65520;
|
||||||
{$else}
|
{$else}
|
||||||
heapsize_limit:=high(heapsize);
|
heapsize_limit:=high(longint);
|
||||||
maxheapsize_limit:=high(maxheapsize);
|
maxheapsize_limit:=high(longint);
|
||||||
{$endif}
|
{$endif}
|
||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
l:=current_scanner.readval;
|
l:=current_scanner.readval;
|
||||||
@ -899,14 +902,14 @@ unit scandir;
|
|||||||
begin
|
begin
|
||||||
current_scanner.readchar;
|
current_scanner.readchar;
|
||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
l:=current_scanner.readval;
|
l:=current_scanner.readval64;
|
||||||
if l>=1024 then
|
if l>=1024 then
|
||||||
heapsize:=min(l,heapsize_limit);
|
heapsize:=min(l,heapsize_limit);
|
||||||
if c=',' then
|
if c=',' then
|
||||||
begin
|
begin
|
||||||
current_scanner.readchar;
|
current_scanner.readchar;
|
||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
l:=current_scanner.readval;
|
l:=current_scanner.readval64;
|
||||||
if l>=heapsize then
|
if l>=heapsize then
|
||||||
maxheapsize:=min(l,maxheapsize_limit)
|
maxheapsize:=min(l,maxheapsize_limit)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user