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

Marcos Douglas md at delfire.net
Tue Jan 3 12:42:38 CET 2012


On Fri, Dec 30, 2011 at 3:09 PM, Hans-Peter Diettrich
<DrDiettrich1 at 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



More information about the fpc-devel mailing list