mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 12:49:09 +02:00
* get rid of WebAssembly constant DefaultMaxMemoryForThreads, because it was
repeated twice. Instead, set maxheapsize correctly with the default value in init_parser.
This commit is contained in:
parent
2dd610c140
commit
44f58c702f
@ -4928,15 +4928,11 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
|
||||||
DefaultMaxMemoryForThreads = 33554432;
|
|
||||||
var
|
var
|
||||||
cust_sec: TWasmCustomSectionType;
|
cust_sec: TWasmCustomSectionType;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
FMaxMemoryPages:=align(maxheapsize,WasmPageSize) div WasmPageSize;
|
FMaxMemoryPages:=align(maxheapsize,WasmPageSize) div WasmPageSize;
|
||||||
if (ts_wasm_threads in current_settings.targetswitches) and (FMaxMemoryPages<=0) then
|
|
||||||
FMaxMemoryPages:=align(DefaultMaxMemoryForThreads,WasmPageSize) div WasmPageSize;
|
|
||||||
|
|
||||||
{ each custom sections starts with its name }
|
{ each custom sections starts with its name }
|
||||||
for cust_sec in TWasmCustomSectionType do
|
for cust_sec in TWasmCustomSectionType do
|
||||||
|
@ -199,6 +199,13 @@ implementation
|
|||||||
if heapsize=0 then
|
if heapsize=0 then
|
||||||
heapsize:=65536;
|
heapsize:=65536;
|
||||||
end;
|
end;
|
||||||
|
system_wasm32_wasi:
|
||||||
|
begin
|
||||||
|
if ts_wasm_threads in init_settings.targetswitches then
|
||||||
|
maxheapsize:=33554432
|
||||||
|
else
|
||||||
|
maxheapsize:=0;
|
||||||
|
end;
|
||||||
{$ifdef i8086}
|
{$ifdef i8086}
|
||||||
system_i8086_embedded:
|
system_i8086_embedded:
|
||||||
begin
|
begin
|
||||||
|
@ -129,7 +129,6 @@ end;
|
|||||||
function tlinkerwasi.MakeExecutable:boolean;
|
function tlinkerwasi.MakeExecutable:boolean;
|
||||||
const
|
const
|
||||||
PageSize = 65536;
|
PageSize = 65536;
|
||||||
DefaultMaxMemoryForThreads = 33554432;
|
|
||||||
var
|
var
|
||||||
GCSectionsStr : ansistring;
|
GCSectionsStr : ansistring;
|
||||||
binstr, cmdstr : Tcmdstr;
|
binstr, cmdstr : Tcmdstr;
|
||||||
@ -179,8 +178,6 @@ begin
|
|||||||
if ts_wasm_threads in current_settings.targetswitches then
|
if ts_wasm_threads in current_settings.targetswitches then
|
||||||
begin
|
begin
|
||||||
cmdstr := cmdstr + ' --import-memory --shared-memory --global-base=1024';
|
cmdstr := cmdstr + ' --import-memory --shared-memory --global-base=1024';
|
||||||
if maxmem<=0 then
|
|
||||||
maxmem:=align(DefaultMaxMemoryForThreads,PageSize);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if initialmem>0 then
|
if initialmem>0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user