mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 10:48:30 +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;
|
||||
|
||||
const
|
||||
DefaultMaxMemoryForThreads = 33554432;
|
||||
var
|
||||
cust_sec: TWasmCustomSectionType;
|
||||
begin
|
||||
result:=false;
|
||||
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 }
|
||||
for cust_sec in TWasmCustomSectionType do
|
||||
|
@ -199,6 +199,13 @@ implementation
|
||||
if heapsize=0 then
|
||||
heapsize:=65536;
|
||||
end;
|
||||
system_wasm32_wasi:
|
||||
begin
|
||||
if ts_wasm_threads in init_settings.targetswitches then
|
||||
maxheapsize:=33554432
|
||||
else
|
||||
maxheapsize:=0;
|
||||
end;
|
||||
{$ifdef i8086}
|
||||
system_i8086_embedded:
|
||||
begin
|
||||
|
@ -129,7 +129,6 @@ end;
|
||||
function tlinkerwasi.MakeExecutable:boolean;
|
||||
const
|
||||
PageSize = 65536;
|
||||
DefaultMaxMemoryForThreads = 33554432;
|
||||
var
|
||||
GCSectionsStr : ansistring;
|
||||
binstr, cmdstr : Tcmdstr;
|
||||
@ -179,8 +178,6 @@ begin
|
||||
if ts_wasm_threads in current_settings.targetswitches then
|
||||
begin
|
||||
cmdstr := cmdstr + ' --import-memory --shared-memory --global-base=1024';
|
||||
if maxmem<=0 then
|
||||
maxmem:=align(DefaultMaxMemoryForThreads,PageSize);
|
||||
end;
|
||||
|
||||
if initialmem>0 then
|
||||
|
Loading…
Reference in New Issue
Block a user