RE: pfMemory problem

New Message Reply Date view Thread view Subject view Author view

Michael T. Jones (mtj++at++babar.asd.sgi.com)
Mon, 6 May 1996 07:29:15 -0700


Gene Writes:
:What is the difference between
:
: pfVec3 *coords = (pfVec3 *) new(4*sizeof(pfVec3)) pfMemory;
:and
: pfVec3 *coords = (pfVec3 *) pfMemory::malloc(4*sizeof(pfVec3), arena);
                                                                       ^^^^^

The difference is that the first form is defaulting to a NULL arena
pointer which means "allocate on the heap", while the second is doing
the allocation from whatever arena the variable "arena" points to.
If "arena" is NULL, then the results should be the same, but if the
variable "arena" has a value returned by pfGetSharedArena(), then
the memory will be allocated such that all processes can see the
same data at the same address.

Michael

Be seeing you, Phone:415.933.1455 Fax:415.965.2658 M/S:8U-590
Michael T. Jones Silicon Graphics, Advanced Systems Division
mtj++at++sgi.com 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311
                    "Du musst Amboss oder Hammer sein" -- Goethe


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:52 PDT

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