D pointers

Kuba Ober kuba at mareimbrium.org
Sun Oct 2 16:01:32 BST 2005


On Saturday 01 October 2005 11:35, George Staikos wrote:
> On Saturday 01 October 2005 11:16, Stephan Kulow wrote:
> > Am Samstag, 1. Oktober 2005 17:00 schrieb Thiago Macieira:
> > > The optimising compiler will very likely elect this->d to be cached in
> > > a register, just like this itself is.
> >
> > Yeah, right. Glad we have soo many registers on i386.
>
>   I'm glad someone else pointed this out.  I was trying to get out of this
> conversation altogether (and I will just revert changes to my own classes
> that I don't like), but this is a very valid point.

No, it's not. Pardon me, but this is a point made by someone whose idea of 
what the x86 architecture is has been frozen back in i386 times. There's a 
big difference between how x86 architecture looks to the 'user' (say an 
assembly coder) and to the actual hardware that carries out those 
instructions.

And then, it'd still be a moot point as the 'this pointer' indirection is 
already there, and somehow we got used to it. Even if you were coding for a 
decade old i486 system, there should be no performance difference between 
using the 'this' pointer vs. 'this->d', if the compiler is doing its job 
properly.

Cheers, Kuba




More information about the kde-core-devel mailing list