[cfe-dev] How to override new operator in modules

Thompson, John John_Thompson at playstation.sony.com
Wed Mar 4 12:08:26 PST 2015


Sorry, I didn't mention that when I try to build the library with the overridden new and delete operators, I get the following compile error:

5>  In file included from D:\Sony\wws_shared\sdk\trunk\components\wws_mem\example\debugging\debugging.cpp:18:
5>  In file included from ..\..\..\wws_mem/wws_mem_all.h:173:
5>..\..\..\wws_mem/wws_mem_new.h(149,16): error : redefinition of 'operator new'
5>  D:\usr\local\psp2\ORBIS SDKs\2.500_pre_mod\target\include\new(123,14) :  note: previous definition is here

The new function signatures are effectively the same.

Is this the effective end of overriding global  new and delete?

Thanks.

-John

From: Thompson, John
Sent: Wednesday, March 04, 2015 12:00 PM
To: cfe-dev at cs.uiuc.edu
Subject: How to override new operator in modules

How do you override global new and delete operators when they are also defined in the "new" standard header included in modules?

I'm trying to build a memory allocator library against a set of PS4 headers that have been modularized.  The memory library overrides new and delete.  In the PS4 headers the "new" header is included in the standard headers.

Thanks.

-John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150304/385c7c47/attachment.html>


More information about the cfe-dev mailing list