This is so important...
Adittion 1
=======
What happens to a C++ object in 64x? The first field is always the VTP. In 32x it is surely 32 bits. In 64x is it now 64 bits?
If the answer is YES then read on.
It is very easy to add a compiler option -vtp32 that will do this:
1. It will compile VTP in 32 bits.
2. It will make sure that this address is valid in the 64x virtual space.
Simply because the virtual tables are loaded to lower vm close to start of application vm space. So any 32 bits filled up with zeros is valid in 64x.
I don't know if this idea has ever crossed your mind. Please let me know.
Adittion 2
=======
On top of that we insist that 64 bits for VTP is the worst sort of bad use of computer science, I want to look at another idea whose time as come. Add a new option to the C++ compiler like -vtp2014.
What would be that option? To elliminate the VTP from the object.
Instead the compiler will set a class number in the this 32bit space at the start of the object.
This number is a const and the compiler adds extra few lines for a virtual function call: first it will compute the VTP through the const number with some global table gtbab[num]. And go through the regular motions.
Why would this is great? Yes it is slower but who cares? In giga hertz computing this is more the OK. The main advantage which is huge in my eyes is the dream land of serialization. We do not have to restore the VTP. The object can be copied as is to disk. And pointer to such memory will be a valid C++ pointer without need for any runtime initialization.
Please write your ideas on this issue.
I hope Byarne is reading this. :-)
Thank You.