From: Goncalo Nuno Moutinho De Carvalho (C3099023++at++tees.ac.uk)
Date: 09/24/2003 09:18:20
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
-----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Wed Sep 24 2003 - 09:23:35 PDT