* moved align helper so it actually gets inlined

git-svn-id: trunk@40011 -
This commit is contained in:
florian 2018-10-21 20:50:21 +00:00
parent 2a3eeab96d
commit 33463c8698

View File

@ -14,6 +14,24 @@
**********************************************************************}
function align(addr : PtrUInt;alignment : PtrUInt) : PtrUInt;{$ifdef SYSTEMINLINE}inline;{$endif}
var
tmp: PtrUInt;
begin
tmp:=addr+PtrUInt(alignment-1);
result:=tmp-(tmp mod alignment)
end;
{$ifndef cpujvm}
function align(addr : Pointer;alignment : PtrUInt) : Pointer;{$ifdef SYSTEMINLINE}inline;{$endif}
var
tmp: PtrUInt;
begin
tmp:=PtrUInt(addr)+(alignment-1);
result:=pointer(tmp-(tmp mod alignment));
end;
{$endif}
{****************************************************************************
Primitives
@ -21,7 +39,6 @@
type
pstring = ^shortstring;
{$ifndef FPC_HAS_SHORTSTR_SHORTSTR_INTERN_CHARMOVE}
{$define FPC_HAS_SHORTSTR_SHORTSTR_INTERN_CHARMOVE}
procedure fpc_shortstr_shortstr_intern_charmove(const src: shortstring; const srcindex: byte; var dst: shortstring; const dstindex, len: byte); {$ifdef SYSTEMINLINE}inline;{$endif}
@ -2423,27 +2440,6 @@ procedure inclocked(var l:int64);
{_$error Sptr must be defined for each processor }
{$endif ndef FPC_SYSTEM_HAS_SPTR}
function align(addr : PtrUInt;alignment : PtrUInt) : PtrUInt;{$ifdef SYSTEMINLINE}inline;{$endif}
var
tmp: PtrUInt;
begin
tmp:=addr+PtrUInt(alignment-1);
result:=tmp-(tmp mod alignment)
end;
{$ifndef cpujvm}
function align(addr : Pointer;alignment : PtrUInt) : Pointer;{$ifdef SYSTEMINLINE}inline;{$endif}
var
tmp: PtrUInt;
begin
tmp:=PtrUInt(addr)+(alignment-1);
result:=pointer(tmp-(tmp mod alignment));
end;
{$endif}
{****************************************************************************
Str()
****************************************************************************}