mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 19:39:31 +02:00
* win64 has always SetThreadStackGuarantee
This commit is contained in:
parent
a774075f2f
commit
acb6c7f36b
@ -273,8 +273,14 @@ type
|
||||
function GetModuleHandle(p : PAnsiChar) : THandle;
|
||||
stdcall;external KernelDLL name 'GetModuleHandleA';
|
||||
|
||||
{$ifdef win64}
|
||||
{ all win64 versions have this function, including 64 bit XP }
|
||||
function SetThreadStackGuarantee(StackSizeInBytes : PPtrUint) : BOOL;
|
||||
stdcall;external KernelDLL name 'SetThreadStackGuarantee';
|
||||
{$else win64}
|
||||
var
|
||||
SetThreadStackGuarantee: function(StackSizeInBytes : PPtrUint) : BOOL; stdcall;
|
||||
{$endif win64}
|
||||
{$else WINCE}
|
||||
|
||||
{ module functions }
|
||||
|
@ -230,7 +230,9 @@ var
|
||||
begin
|
||||
InitThread(ti.stklen);
|
||||
{$ifndef wince}
|
||||
{$ifdef win32}
|
||||
if Assigned(SetThreadStackGuarantee) then
|
||||
{$endif win32}
|
||||
SetThreadStackGuarantee(@StackMargin);
|
||||
{$endif wince}
|
||||
end;
|
||||
|
@ -478,9 +478,7 @@ initialization
|
||||
{ pass dummy value }
|
||||
StackLength := CheckInitialStkLen($1000000);
|
||||
StackBottom := StackTop - StackLength;
|
||||
CodePointer(SetThreadStackGuarantee) := WinGetProcAddress(WinGetModuleHandleW(KernelDLL), 'SetThreadStackGuarantee');
|
||||
if Assigned(SetThreadStackGuarantee) then
|
||||
SetThreadStackGuarantee(@StackMargin);
|
||||
SetThreadStackGuarantee(@StackMargin);
|
||||
|
||||
{ get some helpful informations }
|
||||
GetStartupInfo(@startupinfo);
|
||||
|
Loading…
Reference in New Issue
Block a user