Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Virtual Function (VPTR) propagation problem

Chaitanya_PuneChaitanya_Pune Member Posts: 87
Hi I am using VC++ 6.0.

I have a Base class in which I have a virtual function.

From this base class I have derived 500 classes in which I have overridden that virtual function. Now VPTR will get inserted in all these 500 classes.

Suppose I dont have lavish memory facility such as desktopt PC and I want to run my application on some PDA then what could be the remedy to the mentioned problem?

Can anyone help?

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    : Hi I am using VC++ 6.0.
    :
    : I have a Base class in which I have a virtual function.
    :
    : From this base class I have derived 500 classes in which I have overridden that virtual function. Now VPTR will get inserted in all these 500 classes.
    :
    : Suppose I dont have lavish memory facility such as desktopt PC and I want to run my application on some PDA then what could be the remedy to the mentioned problem?
    :
    : Can anyone help?
    :

    Do you have all 500 classes in the same program? That's only 500 pointers, or roughly 2,000 bytes of data. Otherwise, the VPTR will contain pointers for only those classes the program actually uses.


  • Chaitanya_PuneChaitanya_Pune Member Posts: 87
    : : Hi I am using VC++ 6.0.
    : :
    : : I have a Base class in which I have a virtual function.
    : :
    : : From this base class I have derived 500 classes in which I have overridden that virtual function. Now VPTR will get inserted in all these 500 classes.
    : :
    : : Suppose I dont have lavish memory facility such as desktopt PC and I want to run my application on some PDA then what could be the remedy to the mentioned problem?
    : :
    : : Can anyone help?
    : :
    :
    : Do you have all 500 classes in the same program? That's only 500 pointers, or roughly 2,000 bytes of data. Otherwise, the VPTR will contain pointers for only those classes the program actually uses.
    :
    :
    :
    Ya I do use all of them. Also I can't afford even 2000 bytes. Is there any technical solution?
Sign In or Register to comment.