Re: Help with pfRealloc!

New Message Reply Date view Thread view Subject view Author view

Steve Baker (sbaker++at++link.com)
Sat, 13 Dec 1997 00:11:42 -0600 (CST)


On Fri, 12 Dec 1997, Pari Natarajan wrote:

> Is there a way to allocate memory in the shared memory using
> pfRealloc. pfMalloc and pfCalloc have options for it. But was not
> able to figure out how to use pfRealloc to allocate in shared memory.
> The man page says that its possible.

Since pfRealloc might choose to simply extend the existing memory
block (rather than allocating a new one and copying the data), it
is certain the pfRealloc can only use the same memory arena for
the reallocated block as was use for the block that needed to
be extended. Hence, there is no need for an 'arena' argument.

So, the short answer is: If the memory you are reallocating
is already in a shared memory arena - then so will the reallocated
memory. If the memory you are reallocating *isn't* in the shared
arena - then neither will the reallocated block.

AFAIK, there is no way to reallocate a non-shared memory block
into a shared memory arena without doing it yourself by doing
a pfMalloc and then a memcpy.

Steve Baker 817-619-8776 (Vox/Vox-Mail)
Hughes Training Inc. 817-619-4028 (Fax)
2200 Arlington Downs Road SBaker++at++link.com (eMail)
Arlington, Texas. TX 76005-6171 SJBaker1++at++airmail.net (Personal eMail)
http://www.hti.com http://web2.airmail.net/sjbaker1 (personal)

** Beware of Geeks bearing GIF's. **

=======================================================================
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:56:25 PDT

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