Re: [fpc-devel] Free Pascal 2.6.0 released!

2012-01-03 Thread Michalis Kamburelis

Felipe Monteiro de Carvalho wrote:

On Sun, Jan 1, 2012 at 2:12 PM, Jeff Duntemannj...@duntemann.com  wrote:

Bravo! My only question is: Are there any particular issues with respect to
using 2.6.0 with Lazarus?


For desktop platforms I don't know any issues. It works just as good as 2.4



I just found one small issue: if you use Lazarus 0.9.30.2 to compile 
graphic applications, it will pass -WG option to FPC, on all platforms. 
However FPC 2.6.0 rejects this option (Error: Illegal parameter: -WG) 
on platforms where it's not sensible (like Linux). Bottom line: you 
can't graphic applications from Lazarus (including lazbuild) 0.9.30.2 
using FPC 2.6.0 on Linux.


This is of course fixed in Lazarus SVN by Mattias already :) See 
revisions 31125 and 31127 
(http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revroot=lazarusrevision=31125 
and 
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revroot=lazarusrevision=31127 
). To workaround, you may need to backport these changes for Lazarus 
0.9.30.2 (or just switch to Lazarus SVN, which was my solution :).


Michalis
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Pointer cache for fast class/pointer access.

2012-01-03 Thread Skybuck Flying

Something like this ;):

type
TDepth3 = class
public
 mValue : integer;

 constructor Create;
 destructor Destroy; override;
end;

constructor TDepth3.Create;
begin
mValue := 666;
end;

destructor TDepth3.Destroy;
begin

end;

type
TDepth2 = class
public
 mDepth3 : TDepth3;

 constructor Create;
 destructor Destroy; override;
end;

constructor TDepth2.Create;
begin
mDepth3 := TDepth3.Create;
end;

destructor TDepth2.Destroy;
begin
mDepth3.Free;
end;

type
TDepth1 = class
public
 mDepth2 : TDepth2;

 constructor Create;
 destructor Destroy; override;
end;

constructor TDepth1.Create;
begin
mDepth2 := TDepth2.Create;
end;

destructor TDepth1.Destroy;
begin
mDepth2.Free;
end;


procedure Demo1;
var
mDepth1 : TDepth1;
vValue : integer;
begin
mDepth1 := TDepth1.Create;
vValue := mDepth1.mDepth2.mDepth3.mValue;
writeln( 'vValue: ', vValue );
mDepth1.Free;
end;

I consider .mDepth2.mDepth3 nested classes ;)

Bye,
 Skybuck.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Pointer cache for fast class/pointer access.

2012-01-03 Thread Marcos Douglas
On Fri, Dec 30, 2011 at 3:09 PM, Hans-Peter Diettrich
drdiettri...@aol.com wrote:
 Skybuck Flying schrieb:


 2. Nested/delegated classes incur a pointer access penalty, the deeper
 the nesting the higher the penalty.


 
 Why? Nested classes are not a problem in OPL, more in C++ (multiple
 inheritance!).
 

 Nested classes are a problem because of the pointer overhead.

 For example 100 nested classes will require 100 pointer lookups and thus
 100 instructions.


 Please give example code of what you consider nested classes.



 So a good question would be: what capabilities do classes have which
 objects do not have ?


 Better question: what common capabilitiers are implemented differently in
 Object and TObject?

 Try to answer that question first, then we'll see what you didn't
 understand.

IMHO, I think he talked about:
TFoo = object  [vs]  TFoo = class

Marcos Douglas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Pointer cache for fast class/pointer access.

2012-01-03 Thread Hans-Peter Diettrich

Skybuck Flying schrieb:


vValue := mDepth1.mDepth2.mDepth3.mValue;


You can implement such a funny hierarchy in any language. So what?

DoDi

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re[2]: [fpc-devel] Misterious error

2012-01-03 Thread José Mejuto
Hello FPC,

Monday, January 2, 2012, 9:27:50 PM, you wrote:

 The solution to optimize the unnecessary finally blocks without
 breaking exit behavior is still to
 be found.
SG More sophisticated patch applied in r19955. If you can test
SG your project with it, that would be just 
SG great.

I had updated to 19958 and it still fails with the same SIGSEGV. Again
adding the try..finally..end in the function cures the problem.

[Updating to 19959 to test as my code uses Variants...Done]

No sorry, still the same SIGSEGV :(

Do you know which kind of code I must look for to isolate the problem
?

-- 
Best regards,
 José


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Misterious error

2012-01-03 Thread Sergei Gorelkin

03.01.2012 23:54, José Mejuto пишет:

Hello FPC,

Monday, January 2, 2012, 9:27:50 PM, you wrote:


The solution to optimize the unnecessary finally blocks without
breaking exit behavior is still to
be found.

SG  More sophisticated patch applied in r19955. If you can test
SG  your project with it, that would be just
SG  great.

I had updated to 19958 and it still fails with the same SIGSEGV. Again
adding the try..finally..end in the function cures the problem.

[Updating to 19959 to test as my code uses Variants...Done]

No sorry, still the same SIGSEGV :(

Do you know which kind of code I must look for to isolate the problem
?


I'd suggest looking at the constructors containing an 'exit' statement,
but I'm not entirely sure.

Does restoring removed line 287 of psub.pas remove the segfault?
(The line was:
  include(current_procinfo.flags,pi_needs_implicit_finally); )

Regards,
Sergei
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel