From: MLM Veraart (veraart++at++fel.tno.nl)
Date: 09/29/2003 04:28:34
Or use
class CTriangle
{
PFSTRUCT_DECLARE
public:
};
It will overload the new and delete operators of your class
Mario
Goncalo Nuno Moutinho De Carvalho wrote:
>
> Hey,
>
> Deriving from pfMemory or pfObject should do the trick.
>
> Cheers,
>
> Goncalo
>
> -----Original Message-----
> From: Dimi <christop++at++fhw.gr>
> To: info-performer++at++sgi.com
> Date: Wed, 24 Sep 2003 10:19:51 +0300
> Subject: [info-performer] Allocating classes from shared memory
>
> 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
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
-- ------------------------------------------------------------------------------ The disclaimer that applies to e-mail from TNO Physics and Electronics Laboratory can be found on: http://www.tno.nl/disclaimer/email.html ------------------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Mon Sep 29 2003 - 04:32:58 PDT