Swaminathan N. (swami++at++evl.uic.edu)
Wed, 16 Apr 1997 18:04:17 -0500 (CDT)
If you include <new.h> and a reasonably upto date compiler you could do
placement new like
myClassPtr = new (pfMalloc(sizeof(myClass), pfGetSharedArena())) myClass;
You could also do the same by providing a second version of operator new like
this
void *
operator new(size_t s, void *v) {
return v;
}
which allows you to do the above too. Note that this is different from the
Performer overloading of new, viz.
pfMaterial *mtl = new (pfGetSharedArena()) pfMaterial;
Placement new also helps get around the problem of not being able to overload
operator new []
Swami
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
v Swaminathan Narayanan ^
v swami++at++evl.uic.edu ^
v Office: 996-3002 ^
v Home: 850-2726 ^
v http://www.evl.uic.edu/swami ^
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:05 PDT