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

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jan 4 19:24:03 CET 2012


Skybuck Flying schrieb:
> 
> 
> -----Original Message----- From: Hans-Peter Diettrich
> Sent: Tuesday, January 03, 2012 14:56
> To: FPC developers' list
> Subject: Re: [fpc-devel] Pointer cache for fast class/pointer access.
> 
> Skybuck Flying schrieb:
> 
>> vValue := mDepth1.mDepth2.mDepth3.mValue;
> 
> "
> You can implement such a funny hierarchy in any language. So what?
> "
> 
> For the performance of the line of code above it matters if TObject or 
> Object is used.

Ah, now I understand what you mean. Nonetheless I don't see sane reasons 
for creating such (deeply nested) structures in real life code - records 
would serve the same (demonstrated) purpose.


> Also the slightly different syntax is kinda a shame... this would make 
> it a little bit difficult to flip/flop between different "object models".

I don't see much of a difference here. Objects without constructors can 
be declared as simple variables. Objects on the heap have no advantage 
over TObjects, so that class types can be used for that purpose everywhere.

DoDi




More information about the fpc-devel mailing list