X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a83ea9c15a7ac7bbdc6686164cfcbbc21ae5031a..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/common/memory.cpp?ds=sidebyside diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 94a7e64c66..90812da1f1 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -917,6 +917,9 @@ static MemoryCriticalSection memLocker; #endif +#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) +#ifdef __WXDEBUG__ +#if wxUSE_GLOBAL_MEMORY_OPERATORS void * operator new (size_t size, wxChar * fileName, int lineNum) { return wxDebugAlloc(size, fileName, lineNum, false, false); @@ -947,7 +950,9 @@ void operator delete[] (void * buf) { wxDebugFree(buf, true); } -#endif +#endif // wxUSE_ARRAY_MEMORY_OPERATORS +#endif // !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) +#endif // wxUSE_GLOBAL_MEMORY_OPERATORS // TODO: store whether this is a vector or not. void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) ) @@ -1059,6 +1064,8 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) free((char *)st); } +#endif // __WXDEBUG__ + // Trace: send output to the current debugging stream void wxTrace(const wxChar * ...) { @@ -1137,11 +1144,11 @@ void wxTraceLevel(int, const wxChar * ...) } //---------------------------------------------------------------------------- -// Final cleanup after all global objects in all files have been destructed +// Final cleanup after all global objects in all files have been destroyed //---------------------------------------------------------------------------- // Don't set it to 0 by dynamic initialization -// Some compilers will realy do the asignment later +// Some compilers will really do the assignment later // All global variables are initialized to 0 at the very beginning, and this is just fine. int wxDebugContextDumpDelayCounter::sm_count; @@ -1156,7 +1163,7 @@ void wxDebugContextDumpDelayCounter::DoDump() } // Even if there is nothing else, make sure that there is at -// least one clenup counter object +// least one cleanup counter object static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One; #endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT