pfMalloc & object container

New Message Reply Date view Thread view Subject view Author view

David Chan (dchan++at++zeus.lnk.com)
Tue, 28 Apr 1998 10:25:10 -0400 (EDT)


HI,
        I have a problem with pfMalloc when I am using pfMalloc to create
a shared memory. Here is my simple code:

        shared=(SharedData *)pfMalloc(sizeof(SharedData),
pfGetSharedArena());

while SharedData is a typedef structure, and inside SharedData, there is a
Class container:

        typedef structure {
                ....
                Console *console[10];
                ....
        } SharedData;

Where Class "Console" is an abstract class, the array is to store derived
class from "Console".
        I can create an object and assign it into the array, but after
that, when I want to access the object's public function like this:

        shared->console[0]->

It is always segmentation falut.
I am using "CC" to compile and "cc" to link the object programs on IRIX
6.2 Indy.

Any comment are welcome.
Thanks in advance.
David Chan

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.