Re: new and delete

New Message Reply Date view Thread view Subject view Author view

John Rohlf (jrohlf++at++tubes)
Thu, 5 May 94 16:50:10 PDT


>
> I hope I'm not covering old ground here. I don't see anything in the
> FAQ about it.
>
> I'm running Performer 1.2a with a C++ application. My application
> overloads 'new' and 'delete' for some fancy memory management. It
> appears that Performer also overloads 'new' and 'delete'. Depending
> on what gets linked/referenced first, I get my new/delete or
> Performer's new/delete, and chaos reigns!
>
> I hope I'm doing something wrong, and that the something wrong isn't
> "overloading new and delete." Has anyone else encountered or worked
> around this problem?
>

        You caught us in an unneighborly act. We do indeed overload
new and delete but only delete should be visible to you. The next
release will fix this but for now, modify your link order so that your
delete gets used. Then you'll need to delete Performer memory for us which
is easy:

        long addr = (long)pfGetSharedArena();
        long size = (long)pfGetSharedArenaSize();

        if (p >= addr && p < addr+size)
            afree(p, addr);
        else
            free(p);

Let me know how this works for you.


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:50:16 PDT

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