mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-22 11:58:21 +02:00
* moved align helper so it actually gets inlined
git-svn-id: trunk@40011 -
This commit is contained in:
parent
2a3eeab96d
commit
33463c8698
@ -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
|
Primitives
|
||||||
@ -21,7 +39,6 @@
|
|||||||
type
|
type
|
||||||
pstring = ^shortstring;
|
pstring = ^shortstring;
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_HAS_SHORTSTR_SHORTSTR_INTERN_CHARMOVE}
|
{$ifndef FPC_HAS_SHORTSTR_SHORTSTR_INTERN_CHARMOVE}
|
||||||
{$define 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}
|
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 }
|
{_$error Sptr must be defined for each processor }
|
||||||
{$endif ndef FPC_SYSTEM_HAS_SPTR}
|
{$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()
|
Str()
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
Loading…
Reference in New Issue
Block a user