Don't compile crit. section code on Mac yet
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,15 +44,6 @@
|
|||||||
|
|
||||||
#include "wx/ioswrap.h"
|
#include "wx/ioswrap.h"
|
||||||
|
|
||||||
// Obsolete
|
|
||||||
#if 0
|
|
||||||
#if wxUSE_IOSTREAMH
|
|
||||||
#include <fstream.h>
|
|
||||||
#else
|
|
||||||
#include <fstream>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__WATCOMC__) && !(defined(__VMS__) && ( __VMS_VER < 70000000 ) )\
|
#if !defined(__WATCOMC__) && !(defined(__VMS__) && ( __VMS_VER < 70000000 ) )\
|
||||||
&& !defined( __MWERKS__ ) && !defined(__SALFORDC__)
|
&& !defined( __MWERKS__ ) && !defined(__SALFORDC__)
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
@@ -76,6 +67,13 @@
|
|||||||
|
|
||||||
#include "wx/memory.h"
|
#include "wx/memory.h"
|
||||||
|
|
||||||
|
#if wxUSE_THREADS && defined(__WXDEBUG__) && !defined(__WXMAC__)
|
||||||
|
#define USE_THREADSAFE_MEMORY_ALLOCATION 1
|
||||||
|
#else
|
||||||
|
#define USE_THREADSAFE_MEMORY_ALLOCATION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef new
|
#ifdef new
|
||||||
#undef new
|
#undef new
|
||||||
#endif
|
#endif
|
||||||
@@ -859,7 +857,7 @@ int wxDebugContext::CountObjectsLeft(bool sinceCheckpoint)
|
|||||||
return n ;
|
return n ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if USE_THREADSAFE_MEMORY_ALLOCATION
|
||||||
static bool memSectionOk = FALSE;
|
static bool memSectionOk = FALSE;
|
||||||
|
|
||||||
class MemoryCriticalSection : public wxCriticalSection
|
class MemoryCriticalSection : public wxCriticalSection
|
||||||
@@ -892,7 +890,7 @@ static MemoryCriticalSection memLocker;
|
|||||||
// TODO: store whether this is a vector or not.
|
// TODO: store whether this is a vector or not.
|
||||||
void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) )
|
void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) )
|
||||||
{
|
{
|
||||||
#if wxUSE_THREADS
|
#if USE_THREADSAFE_MEMORY_ALLOCATION
|
||||||
MemoryCriticalSectionLocker lock(memLocker);
|
MemoryCriticalSectionLocker lock(memLocker);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -952,7 +950,7 @@ void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject,
|
|||||||
// TODO: check whether was allocated as a vector
|
// TODO: check whether was allocated as a vector
|
||||||
void wxDebugFree(void * buf, bool WXUNUSED(isVect) )
|
void wxDebugFree(void * buf, bool WXUNUSED(isVect) )
|
||||||
{
|
{
|
||||||
#if wxUSE_THREADS
|
#if USE_THREADSAFE_MEMORY_ALLOCATION
|
||||||
MemoryCriticalSectionLocker lock(memLocker);
|
MemoryCriticalSectionLocker lock(memLocker);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user