diff options
author | Mike Danes <onemihaid@hotmail.com> | 2016-02-18 23:42:35 +0200 |
---|---|---|
committer | Mike Danes <onemihaid@hotmail.com> | 2016-02-18 23:42:35 +0200 |
commit | e73fbfa220876a18366a0037df10ca6f03bcb594 (patch) | |
tree | 8d4a551ad85a6c805571cd87e591ea480b7866f9 /src | |
parent | 3f46cdaf01493289c0382fda9757ad660d364d98 (diff) | |
download | coreclr-e73fbfa220876a18366a0037df10ca6f03bcb594.tar.gz coreclr-e73fbfa220876a18366a0037df10ca6f03bcb594.tar.bz2 coreclr-e73fbfa220876a18366a0037df10ca6f03bcb594.zip |
Do not define global inline new/delete operators
VS2015 Update 2 generates C4595 for such code and the build fails due to /WX
Diffstat (limited to 'src')
-rw-r--r-- | src/ToolBox/SOS/Strike/util.cpp | 11 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/util.h | 13 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index 1239c693c7..1763646632 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -83,6 +83,17 @@ const UINT kcMaxRevertedRejitData = 10; #ifndef FEATURE_PAL +// ensure we always allocate on the process heap +void* __cdecl operator new(size_t size) throw() +{ return HeapAlloc(GetProcessHeap(), 0, size); } +void __cdecl operator delete(void* pObj) throw() +{ HeapFree(GetProcessHeap(), 0, pObj); } + +void* __cdecl operator new[](size_t size) throw() +{ return HeapAlloc(GetProcessHeap(), 0, size); } +void __cdecl operator delete[](void* pObj) throw() +{ HeapFree(GetProcessHeap(), 0, pObj); } + /**********************************************************************\ * Here we define types and functions that support custom COM * * activation rules, as defined by the CIOptions enum. * diff --git a/src/ToolBox/SOS/Strike/util.h b/src/ToolBox/SOS/Strike/util.h index 583c7a651a..68a723226d 100644 --- a/src/ToolBox/SOS/Strike/util.h +++ b/src/ToolBox/SOS/Strike/util.h @@ -1632,19 +1632,6 @@ WCHAR *CreateMethodTableName(TADDR mt, TADDR cmt = NULL); void isRetAddr(DWORD_PTR retAddr, DWORD_PTR* whereCalled); DWORD_PTR GetValueFromExpression (___in __in_z const char *const str); -#ifndef FEATURE_PAL -// ensure we always allocate on the process heap -FORCEINLINE void* __cdecl operator new(size_t size) throw() -{ return HeapAlloc(GetProcessHeap(), 0, size); } -FORCEINLINE void __cdecl operator delete(void* pObj) throw() -{ HeapFree(GetProcessHeap(), 0, pObj); } - -FORCEINLINE void* __cdecl operator new[](size_t size) throw() -{ return HeapAlloc(GetProcessHeap(), 0, size); } -FORCEINLINE void __cdecl operator delete[](void* pObj) throw() -{ HeapFree(GetProcessHeap(), 0, pObj); } -#endif - enum ModuleHeapType { ModuleHeapType_ThunkHeap, |