[info-performer] Allocating classes from shared memory

Date view Thread view Subject view Author view

From: Dimi (christop++at++fhw.gr)
Date: 09/24/2003 00:19:51


Hi,
I currently have a library which stores geometric objects.
Each object say a triangle is represented by a class say CTriangle.
Each class has its own constructors/destructors and the data (vertices,
texture coordinates and others) as member data.
I used to allocate arrays of classes using new like this
for (i=0;i<numofcalsses;i++)
    array[i] = new CTriangle;

I run into problems when I tried to use this library on machines with
more than 1 processors.
When I set up APPCULLDRAW mode (all in one process)the library works
fine.
But as soon I use any other mode which happens on machines with more
than 1 processor,
I get a core dump.

I suspect that I have to allocate any memory from the shared arena.
Until now I used mostly struct
and used the pfMalloc to do that. How can I allocate memory for whole
classes from the shared arena?

Thanks
Dimi


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Sep 24 2003 - 00:25:11 PDT