mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 12:30:31 +02:00
InitHeap to aligned size
This commit is contained in:
parent
d486463bc1
commit
f6726b6a87
@ -128,6 +128,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function alignvalue(x, a : dword): dword;
|
||||||
|
var r : dword;
|
||||||
|
begin
|
||||||
|
r:= x mod a;
|
||||||
|
if r <> 0 then begin
|
||||||
|
result:= x + (a - r);
|
||||||
|
end else result:= x;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StackLength:=CheckInitialStkLen(stklen);
|
StackLength:=CheckInitialStkLen(stklen);
|
||||||
StackBottom:=Pointer(PtrUInt($80200000)-PtrUInt(StackLength));
|
StackBottom:=Pointer(PtrUInt($80200000)-PtrUInt(StackLength));
|
||||||
@ -139,7 +148,7 @@ begin
|
|||||||
IsLibrary := FALSE;
|
IsLibrary := FALSE;
|
||||||
|
|
||||||
{ Setup heap }
|
{ Setup heap }
|
||||||
_InitHeap(pdword(@bss_end),PtrUInt(StackBottom)-PtrUInt(@bss_end));
|
_InitHeap(pdword(@bss_end),alignvalue(PtrUInt(StackBottom)-PtrUInt(@bss_end), 4));
|
||||||
InitHeap;
|
InitHeap;
|
||||||
|
|
||||||
{ Init exceptions }
|
{ Init exceptions }
|
||||||
|
Loading…
Reference in New Issue
Block a user