Re: memory and multiple processes

New Message Reply Date view Thread view Subject view Author view

Jim Helman (jimh++at++surreal)
Fri, 26 Jan 96 06:34:42 -0800


> The answer is pfMalloc... I thought there was a way to use new and
> pfMemory to be more C++ish, but I wasn't able to get anything working.

A user C++ struct can also use the PFSTRUCT_DECLARE macro to
gain an MP smart new operator (basically equivalent to
subclassing from pfStruct except the macro saves a word of
storage that would in each instance be lost if the user struct
were subclassed). pfStructs are not refcountable.

Or pfMalloc(sizeof(mystruct), arena) can be used. Or
new(sizeof(mystruct)) pfMemory. Or new(sizeof(mystruct), arena)
pfMemory. All three are equivalent, except that the latter two
return the pfMemory* while the first returns the pfMemory's data
pointer, i.e. mem->getData(). pfMemories are refcountable.

rgds,

-jim helman

jimh++at++surreal.asd.sgi.com
IRIS Performer/Cosmo3D Java Library
415/933-1151


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.