Re: pfMemory problem

New Message Reply Date view Thread view Subject view Author view

Gene Koh (gene++at++euphoria.corp.sgi.com)
Mon, 6 May 1996 08:23:55 -0700


On May 6, 7:29am, Michael T. Jones wrote:
> Subject: RE: pfMemory problem
> 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

Hi Michael,

I had tried both
        pfVec3 *coords = (pfVec3 *) new(4*sizeof(pfVec3)) pfMemory;
and
        pfVec3 *coords = (pfVec3 *) new(4*sizeof(pfVec3), arena) pfMemory;

The funny thing is, they gave me the same address (0x18087590, which is in the
arena), so I just assumed that allocating from the arena was the default.
 Neither of them worked for me.

Also, I tested this out by changing the multiprocess model in the Performer
example layer.C. That example allocates its geoset data in the first way.
 Even when multiprocessing, the example seems to work fine.

Any other suggestions?

-- 
gene koh		gene++at++corp.sgi.com		415.933.4230

simplicity patience compassion


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.