瀏覽代碼

* moved align helper so it actually gets inlined

git-svn-id: trunk@40011 -
florian 6 年之前
父節點
當前提交
33463c8698
共有 1 個文件被更改,包括 18 次插入22 次删除
  1. 18 22
      rtl/inc/generic.inc

+ 18 - 22
rtl/inc/generic.inc

@@ -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()
 ****************************************************************************}