Swaminathan N. (swami++at++evl.uic.edu)
Fri, 11 Jul 1997 20:34:19 -0500 (CDT)
> > Can you tell me what I am missing?
> >
> > Thank you in advance.
> >
> > Byungsung Cho
> > rtv++at++bbs.para.co.kr
> >
> > "../srScene.C", line 1428: error(3464): no instance of overloaded
> > "operator new" matches these operands
> > sw = new( pfGetSharedArena() ) pfSwitch * [numEvents];
This error occurs because operator new in pfUpdatable hides operator
new(size_t, void *) in pfObject. However operator new for pfUpdatable and
classes derived from it allocates from the shared arena. So there is no need to
use this syntax. Typical use of the above syntax occurs for classes that use
the PFSTRUCT_DECLARE macro, for example the classes declared in pfLinMath.h.
IMHO, I think this overloading will lead to confusion, especially when
including <new.h> and using placement new. ::operator new(size_t, void *p)
constructs the object at the spot designated by the pointer p. However,
pfStruct::operator new(size_t sz, void *p) uses p to allocate sz bytes and constructs
in that space. Passing pfGetSharedArena() as an argument to ::operator new is
plain wrong. However, since in the statement above you're using operator new []
which is not defined at all in any performer include file, you'll probably be
tempted to include <new.h> and thus, disaster strikes, as it did to me.
>
> My bad, I thought I understood the overloaded new in pfObject (my C++ is
> apparently not even that good).
I've been there zillions of times and will probably go there again :-)
bye
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:36 PDT