MMU and vtable

I

Ian Collins

schand said:
How does the virtual table accessed in MMU based system?
The question is too implementation specific. Try a group dedicated to
your environment or you compiler documentation.
 
S

schand

Ian said:
The question is too implementation specific. Try a group dedicated to
your environment or you compiler documentation.

I checked the compiler manual I could not locate the virtual table
implementation. My ARM hardware has MMU enabled and the OS process/task
is running in separate memory area(with MMU support). There is no
shared memory support. So I want to know if two process access the
derived class (virtual pointer) objects and how the virtual table is
shared between these processes. As per my understaning vtable is
stored in the data segment.
 
B

Binary

what is your problem exactly? the data before your fork() will be
copied in both process.
 
I

Ian Collins

schand said:
I checked the compiler manual I could not locate the virtual table
implementation. My ARM hardware has MMU enabled and the OS process/task
is running in separate memory area(with MMU support). There is no
shared memory support. So I want to know if two process access the
derived class (virtual pointer) objects and how the virtual table is
shared between these processes. As per my understaning vtable is
stored in the data segment.
Please set you newsreader to trim signatures.

I don't know of any operating environment where two process can share
objects that use virtual methods.
 
B

Bo Persson

schand said:
I checked the compiler manual I could not locate the virtual table
implementation. My ARM hardware has MMU enabled and the OS
process/task is running in separate memory area(with MMU support).
There is no shared memory support. So I want to know if two process
access the derived class (virtual pointer) objects and how the
virtual table is shared between these processes. As per my
understaning vtable is stored in the data segment.

That is two entirely different uses of the word 'virtual'. They are
not connected in any way.

The MMU handles hardware virtuals, while the vtable is entirely a
software thing (and optional at that).



Bo Persson
 
S

schand

Yes, I know virtual memeory management.

Support we have clas sB derived from Class with virtual functions. If
I understand correctly, compiler will create a virtual table for class
B in the data area and Class B will have a pointer to vtable. Support
Process A and Process B create object of type Class B, ow the vtable is
shared.
 
S

schand

Yes, I know virtual memory management.

Support we have class B derived from Class A which has virtual
functions. If I understand correctly, compiler will create a virtual
table for class B in the data area and Class B will have a pointer to
vtable. Suppose Process A and Process B create object of type Class B,
how the vtable is shared.?
 
K

Kaz Kylheku

schand said:
As per my understaning vtable is stored in the data segment.

Then what more do you want to know from the C++ newsgroup? How data
segment objects are loaded, and how their symbolic addresses are
resolved into run-time references, has absolutely nothing to do with
C++ and everything to do with the platform you are using.
 
I

Ian Collins

schand wrote:

Top posting corrected, please don't!
Yes, I know virtual memeory management.

Support we have clas sB derived from Class with virtual functions. If
I understand correctly, compiler will create a virtual table for class
B in the data area and Class B will have a pointer to vtable. Support
Process A and Process B create object of type Class B, ow the vtable is
shared.

Please set you newsreader to trim signatures.

No, it isn't, unless all your processes share the same address space.
As others have said, you appear to be confusing virtual memory for
virtual inheritance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top