Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-09

{$INLINE OFF}

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

Does this
1) prevent functions declared in this unit from being inlined (in this or other units)
2) functions from other units, that are called in this unit from being inlined:

I get 1, but not 2:

program project1;  {$mode objfpc}{$H+}  {$INLINE OFF}
uses Classes, types;
function MyPoint(X, Y: Integer): TPoint;
begin
   Result.x := x;
   Result.y := y;
end;
var  a: TPoint;
begin
   a := Point(1,1);       // inlined
   a := MyPoint(1,1); // not inlined
end.

Reply by email

Sven Barth
to Martin
Martin wrote 22 lines
Does this 1) prevent functions declared in this unit from being inlined (in this or other units) 2) functions from other units, that are called in this unit from being inlined: I get 1, but not 2: program project1; {$mode objfpc}{$H+} {$INLINE OFF} uses Classes, types; function MyPoint(X, Y: Integer): TPoint; begin Result.x := x; Result.y := y; end; var a: TPoint; begin a := Point(1,1); // inlined a := MyPoint(1,1); // not inlined end.

Note: Your MyPoint will never be inlined as it does not have the "inline" modifier.

Regards,
Sven

Reply by email