+ WebAssembly threads: init StackBottom (used for stack checking) more precisely

when starting a new thread. Precision is not that important for the stack
  checking itself, because it uses a stack margin of 16kb, so the previous
  value, set by InitThread is good enough, however it's easy to do it precisely,
  since we allocate the stack and pass a pointer to it in TWasmThread, so why
  not?
This commit is contained in:
Nikolay Nikolov 2024-08-06 07:01:20 +03:00
parent da59711442
commit 9d771396ff

View File

@ -339,6 +339,7 @@ begin
start_arg^.State:=tsRunning;
InitThread(start_arg^.StackSize);
StackBottom:=start_arg^.StackBlock;
start_arg^.ExitCode:=Cardinal(start_arg^.ThreadFunction(start_arg^.ThreadFunctionArg));
{$IFDEF DEBUGWASMTHREADS}DebugWriteln('FPCWasmThreadStartPascal: Signaling end of thread');{$ENDIF}
WasiRTLEventSetEvent(start_arg^.DoneEvent);