Re: pfMemory clarification

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Fri, 18 Apr 1997 19:43:09 -0700


On Apr 18, 9:31pm, Swaminathan N. wrote:
>
> What I've done (within the limitations of the 6.x compiler) to allocate and
> destroy arrays of objects in shared memory is this...
>
> // to allocate values[num]
> object *values = new (pfMemory::malloc(sizeof(object)*num, arena))
> object[num];
> // to delete the above
> for (int i=0; i<num; i++)
> values[i].~object();
> pfMemory::free(values);
>
> yucky, but I don't know of any other way of ensuring arrays of constructed
> objects in shared memory.

In your example, the value objects are not properly constructed. Calling the
the dtor explicitly is permitted, but you cannot arrange for Performer to do
the right thing in any case, say for an array of objects attached as
pfUserData.

Regards.

--
+ Marcus Barnes, Technical Staff        mailto:marcus++at++multigen.com +
+ Multigen Inc.                         http://www.multigen.com    +
+ 550 S. Winchester Blvd.               phoneto:1-408-556-2654     +
+ Suite 500 San Jose CA 95128           faxto:1-408-261-4102       +
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

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:55:05 PDT

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