Re: operator new() and operator delete()

New Message Reply Date view Thread view Subject view Author view

Geoff Levner (g.levner++at++acsys.it)
Wed, 21 Jul 1999 13:10:32 +0200


Javier Abadia Miranda wrote:
>
> Hello:
>
> I want objects of a class to be allocated from shared
> arena. I have overloaded operators new and delete as
> follows:
>
> (snip)
>
> This seems to work. Is it the _right_ way to allocate
> objects from shared arena?
>
> I'm wondering if I should derive this class and others
> from pfObject or pfMemory to get this allocation behaviour
> automatically.

We do it the same way you do -- when we are not using Performer -- and
it seems to me like the right way. But if you are using Performer, it
is simpler to derive your class from pfObject or pfMemory, as you say.
Note, however, that the default new operator for a pfMemory does NOT
allocate from shared memory (you have to specify the arena), and that
you cannot allocate a pfObject until you have called pfConfig() (I seem
to recall).

-- 
Geoff Levner -- g.levner++at++acsys.it
ACS Studio, via Aurelia 58, 00165 Roma, Italy
tel. +39-063936331, fax +39-0639363317

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Jul 21 1999 - 03:56:44 PDT

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