This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Placement into shared memory?


Hi,

I  would like  to use  placement to  instantiate a  C++ object  into a
shared memory  segment and access  that object from a  second process.
When I test with an integer, the integer is accessible from the second
process.  But when I instantiate a C++ class object, it seems a memory
pointer, which is local within the first process, is placed in memory.
The place object is fully  accessible and usable in the first process.
I am guessing that the pointer points to the class definition within a
table local  to that first process.  Unfortunately,  that table, which
does not  seem to  exist at  the same address  in the  second process,
causes the second process to Seg  fault when it attempts to access the
object instantiated in shared memory.

What  is the  current  correct approach  to  instantiating objects  in
shared memory so that multiple processes can access the C++ objects?

Thank you.

gcc --version
gcc (GCC) 3.4.3
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.



-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]