Nonportable code in C++ support

Kuba Ober kuba at mareimbrium.org
Fri Feb 15 13:50:07 UTC 2008


On Friday 15 February 2008, Esben Mose Hansen wrote:
> On Thursday February 14 2008 14:30:07 Kuba Ober wrote:
> > I don't know how the memory is organized on 64 bit machines, but
> > presumably they have virtual memory too, and one then presumes that say
> > stack, heap and dynamic libraries can be possibly spread all over the
> > petabytes. Just like on some 32 bit platforms - heap, stack and library
> > code are nowhere near one another, there are huge address holes between
> > them.
>
> Sure, it is possible, for the case where someone stores pointers to objects
> on the stack in a hash. But it doesn't really change much.
>
> > I wouldn't call it a big coincidence if the address of some constant
> > allocated in the constant data area had the same last 32 bits as
> > something from the heap, for example.
>
> It could happen, but it is just a hash collision. Which means, it is a
> performance penalty *only*, and on average it should be much smaller than
> doing bit shifting on every single hash lookup.

Hmm, I think you're right. I thought it was one of those situations where if 
the hashes collide you're out of luck.

Cheers, Kuba




More information about the KDevelop-devel mailing list