Re: Allocating pfVec3/pfMaterial/pfGeoState in shared memory with C++ interface

New Message Reply Date view Thread view Subject view Author view

Mario Veraart (rioj7++at++fel.tno.nl)
Thu, 16 Jul 1998 15:11:36 +0200 (MET DST)


> currently we are porting our application from the Performer C API to the C++
> API. We wonder how to allocate coordinates/colors/normals/materials in shared
> memory. The man pages for example for pfVec3 say:
>
> "new allocates a pfVec3 from the default memory arena (-pfGetSharedArena)."
> allocates memory from shared arena.
>
> In the perfly C++ example code you find
>
> coords = (pfVec3*)pfCalloc(4, sizeof(pfVec3), arena);
> Why do you use the C API here? Why not coords=new pfVec4(4, arena)?

The C-Api functions pfMalloc and pfCalloc etc. are redefined with a
#define statement to the static functions of the pfMemory class.

>
> mtl = new pfMaterial();
> Does this allocate mtl in the default shared arena?
Yes, look at the man page for pfMaterial

>
> pfGeoState *gs = new (pfGetSharedArena()) pfGeoState;
> Why not pfGeoState *gs = new pfGeoState;
They are the same for the programmers point of view.

> Thanks for any help.
>
> Best Regards
> Daniela
>
> --

Mario
=======================================================================
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:57:42 PDT

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