diff --git a/BeastConfig.h b/BeastConfig.h
index 2581a865ff..e2514926ff 100644
--- a/BeastConfig.h
+++ b/BeastConfig.h
@@ -63,8 +63,7 @@
/** Config: BEAST_CHECK_MEMORY_LEAKS
Enables a memory-leak check for certain objects when the app terminates.
- See the LeakedObjectDetector and LeakChecked classes, and the
- BEAST_LEAK_DETECTOR macro for more details about enabling leak checking for
+ See the LeakChecked class for more details about enabling leak checking for
specific classes.
*/
#ifndef BEAST_CHECK_MEMORY_LEAKS
diff --git a/Builds/VisualStudio2012/RippleD.vcxproj b/Builds/VisualStudio2012/RippleD.vcxproj
index e80c8cd698..405934b361 100644
--- a/Builds/VisualStudio2012/RippleD.vcxproj
+++ b/Builds/VisualStudio2012/RippleD.vcxproj
@@ -1632,7 +1632,6 @@
-
diff --git a/Builds/VisualStudio2012/RippleD.vcxproj.filters b/Builds/VisualStudio2012/RippleD.vcxproj.filters
index b315793009..a274cefa58 100644
--- a/Builds/VisualStudio2012/RippleD.vcxproj.filters
+++ b/Builds/VisualStudio2012/RippleD.vcxproj.filters
@@ -1788,7 +1788,6 @@
1. Modules\ripple_app\basics
-
diff --git a/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h b/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h
index 3a86bf5537..715c37a44b 100644
--- a/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h
+++ b/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h
@@ -63,8 +63,7 @@
/** Config: BEAST_CHECK_MEMORY_LEAKS
Enables a memory-leak check for certain objects when the app terminates.
- See the LeakedObjectDetector and LeakChecked classes, and the
- BEAST_LEAK_DETECTOR macro for more details about enabling leak checking for
+ See the LeakChecked class for more details about enabling leak checking for
specific classes.
*/
#ifndef BEAST_CHECK_MEMORY_LEAKS
diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj
index 195335e405..9b1d39a8bf 100644
--- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj
+++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj
@@ -143,7 +143,6 @@
-
@@ -152,6 +151,7 @@
+
@@ -749,6 +749,12 @@
true
true
+
+ true
+ true
+ true
+ true
+
true
true
diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters
index 99d27f2677..d7d86413e1 100644
--- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters
+++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters
@@ -226,9 +226,6 @@
beast_core\memory
-
- beast_core\memory
-
beast_core\memory
@@ -617,6 +614,9 @@
beast_core\diagnostic
+
+ beast_core\memory
+
@@ -952,5 +952,8 @@
beast_core\diagnostic
+
+ beast_core\threads
+
\ No newline at end of file
diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h
index 92c7cbe795..058a986349 100644
--- a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h
+++ b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h
@@ -24,7 +24,12 @@
@ingroup beast_concurrent
*/
-#if 0//BEAST_BOOST_IS_AVAILABLE
+// VFALCO NOTE Disabled this because it seems that the TLS
+// implementation has a leak. Although the other
+// one also seems to have a leak.
+//
+//#if BEAST_BOOST_IS_AVAILABLE
+#if 0
typedef FifoFreeStoreWithTLS FifoFreeStoreType;
#else
typedef FifoFreeStoreWithoutTLS FifoFreeStoreType;
diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h b/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h
index c96e3b9522..cb8e3d2a69 100644
--- a/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h
+++ b/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h
@@ -20,24 +20,28 @@
#ifndef BEAST_REFERENCECOUNTEDSINGLETON_BEASTHEADER
#define BEAST_REFERENCECOUNTEDSINGLETON_BEASTHEADER
-/**
- Thread-safe singleton which comes into existence on first use. Use this
- instead of creating objects with static storage duration. These singletons
- are automatically reference counted, so if you hold a pointer to it in every
- object that depends on it, the order of destruction of objects is assured
- to be correct.
+/** Thread-safe singleton which comes into existence on first use. Use this
+ instead of creating objects with static storage duration. These singletons
+ are automatically reference counted, so if you hold a pointer to it in every
+ object that depends on it, the order of destruction of objects is assured
+ to be correct.
- class Object must provide the function `Object* Object::createInstance()`
+ class Object must provide the function `Object* Object::createInstance()`
- @class RefCountedSingleton
- @ingroup beast_core
+ @class RefCountedSingleton
+ @ingroup beast_core
*/
/** @{ */
class BEAST_API SingletonLifetime
{
- // "base classes dependent on a template parameter
- // aren't part of lookup." - ville
public:
+ // It would be nice if we didn't have to qualify the enumeration but
+ // Argument Dependent Lookup is inapplicable here because:
+ //
+ // "Base classes dependent on a template parameter aren't part of lookup."
+ // - ville
+ //
+
/** Construction options for RefCountedSingleton
@ingroup beast_core
@@ -59,6 +63,8 @@ public:
};
};
+//------------------------------------------------------------------------------
+
template
class RefCountedSingleton
: public SingletonLifetime
diff --git a/Subtrees/beast/modules/beast_core/beast_core.cpp b/Subtrees/beast/modules/beast_core/beast_core.cpp
index be3907d179..55a8ab682c 100644
--- a/Subtrees/beast/modules/beast_core/beast_core.cpp
+++ b/Subtrees/beast/modules/beast_core/beast_core.cpp
@@ -183,6 +183,7 @@ namespace beast
#include "streams/beast_MemoryOutputStream.cpp"
#include "streams/beast_OutputStream.cpp"
#include "streams/beast_SubregionStream.cpp"
+
#include "system/beast_SystemStats.cpp"
#include "text/beast_CharacterFunctions.cpp"
@@ -197,6 +198,7 @@ namespace beast
#include "threads/beast_ChildProcess.cpp"
#include "threads/beast_ReadWriteLock.cpp"
+#include "threads/beast_SpinDelay.cpp"
#include "threads/beast_Thread.cpp"
#include "threads/beast_ThreadPool.cpp"
#include "threads/beast_TimeSliceThread.cpp"
diff --git a/Subtrees/beast/modules/beast_core/beast_core.h b/Subtrees/beast/modules/beast_core/beast_core.h
index 0d1d6e1575..8510f7f64d 100644
--- a/Subtrees/beast/modules/beast_core/beast_core.h
+++ b/Subtrees/beast/modules/beast_core/beast_core.h
@@ -198,17 +198,24 @@ namespace beast
// Order matters, since headers don't have their own #include lines.
// Add new includes to the bottom.
-#include "threads/beast_Thread.h"
-#include "threads/beast_SpinDelay.h"
+#include "memory/beast_Uncopyable.h"
+#include "maths/beast_MathsFunctions.h"
#include "memory/beast_Atomic.h"
#include "memory/beast_AtomicCounter.h"
#include "memory/beast_AtomicFlag.h"
#include "memory/beast_AtomicPointer.h"
#include "memory/beast_AtomicState.h"
#include "containers/beast_LockFreeStack.h"
+#include "threads/beast_SpinDelay.h"
#include "memory/beast_StaticObject.h"
#include "diagnostic/beast_LeakChecked.h"
+#include "memory/beast_Memory.h"
+#include "memory/beast_ByteOrder.h"
+#include "logging/beast_Logger.h"
+
+#include "threads/beast_Thread.h"
+
#include "diagnostic/beast_Debug.h"
#include "diagnostic/beast_SafeBool.h"
#include "diagnostic/beast_Error.h"
@@ -251,7 +258,6 @@ namespace beast
#include "maths/beast_Range.h"
#include "memory/beast_ByteOrder.h"
#include "memory/beast_HeapBlock.h"
-#include "memory/beast_LeakedObjectDetector.h"
#include "memory/beast_Memory.h"
#include "memory/beast_MemoryBlock.h"
#include "memory/beast_OptionalScopedPointer.h"
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h b/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h
index 1a6aaf2009..f0fe0e571e 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h
@@ -81,7 +81,7 @@
};
@endcode
*/
-class BEAST_API AbstractFifo
+class BEAST_API AbstractFifo : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -206,8 +206,6 @@ private:
//==============================================================================
int bufferSize;
Atomic validStart, validEnd;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AbstractFifo)
};
#endif
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_ArrayAllocationBase.h b/Subtrees/beast/modules/beast_core/containers/beast_ArrayAllocationBase.h
index 9f1ffe1147..4fb0d5767f 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_ArrayAllocationBase.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_ArrayAllocationBase.h
@@ -40,7 +40,8 @@
@see Array, OwnedArray, ReferenceCountedArray
*/
template
-class ArrayAllocationBase : public TypeOfCriticalSectionToUse
+class ArrayAllocationBase
+ : public TypeOfCriticalSectionToUse
{
public:
//==============================================================================
@@ -126,9 +127,6 @@ public:
//==============================================================================
HeapBlock elements;
int numAllocated;
-
-private:
- BEAST_DECLARE_NON_COPYABLE (ArrayAllocationBase)
};
#endif // BEAST_ARRAYALLOCATIONBASE_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_DynamicObject.h b/Subtrees/beast/modules/beast_core/containers/beast_DynamicObject.h
index 08ce6d21b7..66901d99bd 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_DynamicObject.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_DynamicObject.h
@@ -39,7 +39,9 @@
by subclassing hasMethod() and invokeMethod(), you can give your object
methods.
*/
-class BEAST_API DynamicObject : public ReferenceCountedObject
+class BEAST_API DynamicObject
+ : public ReferenceCountedObject
+ , LeakChecked
{
public:
//==============================================================================
@@ -112,8 +114,6 @@ public:
private:
//==============================================================================
NamedValueSet properties;
-
- BEAST_LEAK_DETECTOR (DynamicObject)
};
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_HashMap.h b/Subtrees/beast/modules/beast_core/containers/beast_HashMap.h
index d488020bcc..cee0dfd6b2 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_HashMap.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_HashMap.h
@@ -95,6 +95,11 @@ template
class HashMap
+ : Uncopyable
+ , LeakChecked >
{
private:
typedef PARAMETER_TYPE (KeyType) KeyTypeParameter;
@@ -333,7 +338,7 @@ public:
private:
//==============================================================================
- class HashEntry
+ class HashEntry : Uncopyable
{
public:
HashEntry (KeyTypeParameter k, ValueTypeParameter val, HashEntry* const next)
@@ -343,8 +348,6 @@ private:
const KeyType key;
ValueType value;
HashEntry* nextEntry;
-
- BEAST_DECLARE_NON_COPYABLE (HashEntry)
};
public:
@@ -371,7 +374,7 @@ public:
@see HashMap
*/
- class Iterator
+ class Iterator : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -420,8 +423,6 @@ public:
const HashMap& hashMap;
HashEntry* entry;
int index;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Iterator)
};
private:
@@ -439,8 +440,6 @@ private:
bassert (isPositiveAndBelow (hash, getNumSlots())); // your hash function is generating out-of-range numbers!
return hash;
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HashMap)
};
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_LinkedListPointer.h b/Subtrees/beast/modules/beast_core/containers/beast_LinkedListPointer.h
index 4ac97c5849..da6785669e 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_LinkedListPointer.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_LinkedListPointer.h
@@ -53,7 +53,7 @@
@endcode
*/
template
-class LinkedListPointer
+class LinkedListPointer : Uncopyable
{
public:
//==============================================================================
@@ -330,7 +330,7 @@ public:
list, and then repeatedly call Appender::append() to add items to the end
of the list in O(1) time.
*/
- class Appender
+ class Appender : Uncopyable
{
public:
/** Creates an appender which will add items to the given list.
@@ -351,15 +351,11 @@ public:
private:
LinkedListPointer* endOfList;
-
- BEAST_DECLARE_NON_COPYABLE (Appender)
};
private:
//==============================================================================
ObjectType* item;
-
- BEAST_DECLARE_NON_COPYABLE (LinkedListPointer)
};
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_NamedValueSet.h b/Subtrees/beast/modules/beast_core/containers/beast_NamedValueSet.h
index 1c2d08d93b..b451832f83 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_NamedValueSet.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_NamedValueSet.h
@@ -132,7 +132,7 @@ public:
private:
//==============================================================================
- class NamedValue
+ class NamedValue : LeakChecked
{
public:
NamedValue() noexcept;
@@ -151,7 +151,6 @@ private:
var value;
private:
- BEAST_LEAK_DETECTOR (NamedValue)
};
friend class LinkedListPointer;
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_OwnedArray.h b/Subtrees/beast/modules/beast_core/containers/beast_OwnedArray.h
index bb134cc36e..9ad612b861 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_OwnedArray.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_OwnedArray.h
@@ -51,7 +51,7 @@
template
-class OwnedArray
+class OwnedArray : LeakChecked >, Uncopyable
{
public:
//==============================================================================
@@ -907,8 +907,6 @@ private:
while (numUsed > 0)
delete data.elements [--numUsed];
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OwnedArray)
};
#endif // BEAST_OWNEDARRAY_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_PropertySet.h b/Subtrees/beast/modules/beast_core/containers/beast_PropertySet.h
index f6513acc35..c3b5e61c8f 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_PropertySet.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_PropertySet.h
@@ -39,7 +39,7 @@
See the PropertiesFile class for a subclass of this, which automatically broadcasts change
messages and saves/loads the list from a file.
*/
-class BEAST_API PropertySet
+class BEAST_API PropertySet : LeakChecked
{
public:
//==============================================================================
@@ -206,8 +206,6 @@ private:
PropertySet* fallbackProperties;
CriticalSection lock;
bool ignoreCaseOfKeys;
-
- BEAST_LEAK_DETECTOR (PropertySet)
};
diff --git a/Subtrees/beast/modules/beast_core/containers/beast_ScopedValueSetter.h b/Subtrees/beast/modules/beast_core/containers/beast_ScopedValueSetter.h
index 945ee13a5d..3709d6e721 100644
--- a/Subtrees/beast/modules/beast_core/containers/beast_ScopedValueSetter.h
+++ b/Subtrees/beast/modules/beast_core/containers/beast_ScopedValueSetter.h
@@ -52,7 +52,7 @@
*/
template
-class ScopedValueSetter
+class ScopedValueSetter : Uncopyable
{
public:
/** Creates a ScopedValueSetter that will immediately change the specified value to the
@@ -87,8 +87,6 @@ private:
//==============================================================================
ValueType& value;
const ValueType originalValue;
-
- BEAST_DECLARE_NON_COPYABLE (ScopedValueSetter)
};
diff --git a/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp
index 0688c3cd28..7b68e983a3 100644
--- a/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp
+++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp
@@ -19,8 +19,6 @@
#if BEAST_USE_LEAKCHECKED
-/*============================================================================*/
-// Type-independent portion of Counter
class LeakCheckedBase::CounterBase::Singleton
{
public:
@@ -76,8 +74,18 @@ void LeakCheckedBase::CounterBase::detectLeaks ()
if (count > 0)
{
+ /** If you hit this, then you've leaked one or more objects of the
+ specified class; the name should have been printed by the line
+ below.
+
+ If you're leaking, it's probably because you're using old-fashioned,
+ non-RAII techniques for your object management. Tut, tut. Always,
+ always use ScopedPointers, OwnedArrays, ReferenceCountedObjects,
+ etc, and avoid the 'delete' operator at all costs!
+ */
+ DBG ("Leaked objects: " << count << " of " << getClassName ());
+
//bassertfalse;
- DBG ("[LEAK] " << count << " of " << getClassName ());
}
}
diff --git a/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h
index 1b25f2a740..36990fa94e 100644
--- a/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h
+++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h
@@ -78,28 +78,37 @@ class LeakChecked : private LeakCheckedBase
protected:
LeakChecked () noexcept
{
- if (getLeakCheckedCounter ().increment () == 0)
- {
- DBG ("[LOGIC] " << getLeakCheckedName ());
- Throw (Error ().fail (__FILE__, __LINE__));
- }
+ getCounter ().increment ();
}
LeakChecked (const LeakChecked&) noexcept
{
- if (getLeakCheckedCounter ().increment () == 0)
- {
- DBG ("[LOGIC] " << getLeakCheckedName ());
- Throw (Error ().fail (__FILE__, __LINE__));
- }
+ getCounter ().increment ();
}
~LeakChecked ()
{
- if (getLeakCheckedCounter ().decrement () < 0)
+ if (getCounter ().decrement () < 0)
{
- DBG ("[LOGIC] " << getLeakCheckedName ());
- Throw (Error ().fail (__FILE__, __LINE__));
+ /* If you hit this, then you've managed to delete more instances
+ of this class than you've created. That indicates that you're
+ deleting some dangling pointers.
+
+ Note that although this assertion will have been triggered
+ during a destructor, it might not be this particular deletion
+ that's at fault - the incorrect one may have happened at an
+ earlier point in the program, and simply not been detected
+ until now.
+
+ Most errors like this are caused by using old-fashioned,
+ non-RAII techniques for your object management. Tut, tut.
+ Always, always use ScopedPointers, OwnedArrays,
+ ReferenceCountedObjects, etc, and avoid the 'delete' operator
+ at all costs!
+ */
+ DBG ("Dangling pointer deletion: " << getLeakCheckedName ());
+
+ bassertfalse;
}
}
@@ -130,16 +139,17 @@ private:
return typeid (Object).name ();
}
- static Counter& getLeakCheckedCounter () noexcept
+ static Counter& getCounter () noexcept
{
static Counter* volatile s_instance;
static Static::Initializer s_initializer;
- if (s_initializer.begin ())
+ if (s_initializer.beginConstruction ())
{
static char s_storage [sizeof (Counter)];
s_instance = new (s_storage) Counter;
- s_initializer.end ();
+
+ s_initializer.endConstruction ();
}
return *s_instance;
diff --git a/Subtrees/beast/modules/beast_core/files/beast_DirectoryIterator.h b/Subtrees/beast/modules/beast_core/files/beast_DirectoryIterator.h
index 3ba068a899..144dca788c 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_DirectoryIterator.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_DirectoryIterator.h
@@ -41,7 +41,7 @@
It can also guess how far it's got using a wildly inaccurate algorithm.
*/
-class BEAST_API DirectoryIterator
+class BEAST_API DirectoryIterator : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -116,7 +116,7 @@ public:
private:
//==============================================================================
- class NativeIterator
+ class NativeIterator : LeakChecked , Uncopyable
{
public:
NativeIterator (const File& directory, const String& wildCard);
@@ -132,8 +132,6 @@ private:
friend class DirectoryIterator;
friend class ScopedPointer;
ScopedPointer pimpl;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeIterator)
};
friend class ScopedPointer;
@@ -147,8 +145,6 @@ private:
bool hasBeenAdvanced;
ScopedPointer subIterator;
File currentFile;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator)
};
#endif // BEAST_DIRECTORYITERATOR_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/files/beast_File.cpp b/Subtrees/beast/modules/beast_core/files/beast_File.cpp
index ffa83d7260..7fa1e889a1 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_File.cpp
+++ b/Subtrees/beast/modules/beast_core/files/beast_File.cpp
@@ -26,6 +26,15 @@ File::File (const String& fullPathName)
{
}
+File::File (const File& other)
+ : fullPath (other.fullPath)
+{
+}
+
+File::~File() noexcept
+{
+}
+
File File::createFileWithoutCheckingPath (const String& path) noexcept
{
File f;
@@ -33,11 +42,6 @@ File File::createFileWithoutCheckingPath (const String& path) noexcept
return f;
}
-File::File (const File& other)
- : fullPath (other.fullPath)
-{
-}
-
File& File::operator= (const String& newPath)
{
fullPath = parseAbsolutePath (newPath);
diff --git a/Subtrees/beast/modules/beast_core/files/beast_File.h b/Subtrees/beast/modules/beast_core/files/beast_File.h
index 462aeb58a9..839ae0b623 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_File.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_File.h
@@ -46,7 +46,7 @@ class FileOutputStream;
@see FileInputStream, FileOutputStream
*/
-class BEAST_API File
+class BEAST_API File : LeakChecked
{
public:
//==============================================================================
@@ -76,7 +76,7 @@ public:
File (const File& other);
/** Destructor. */
- ~File() noexcept {}
+ ~File() noexcept;
/** Sets the file based on an absolute pathname.
@@ -948,8 +948,6 @@ private:
bool setFileTimesInternal (int64 m, int64 a, int64 c) const;
void getFileTimesInternal (int64& m, int64& a, int64& c) const;
bool setFileReadOnlyInternal (bool) const;
-
- BEAST_LEAK_DETECTOR (File)
};
#endif // BEAST_FILE_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/files/beast_FileInputStream.h b/Subtrees/beast/modules/beast_core/files/beast_FileInputStream.h
index 72ee64f126..1e1d94fecf 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_FileInputStream.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_FileInputStream.h
@@ -34,7 +34,9 @@
@see InputStream, FileOutputStream, File::createInputStream
*/
-class BEAST_API FileInputStream : public InputStream
+class BEAST_API FileInputStream
+ : public InputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -87,8 +89,6 @@ private:
void openHandle();
void closeHandle();
size_t readInternal (void* buffer, size_t numBytes);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileInputStream)
};
#endif // BEAST_FILEINPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/files/beast_FileOutputStream.h b/Subtrees/beast/modules/beast_core/files/beast_FileOutputStream.h
index a51d806c51..5f358ecd63 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_FileOutputStream.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_FileOutputStream.h
@@ -34,7 +34,9 @@
@see OutputStream, FileInputStream, File::createOutputStream
*/
-class BEAST_API FileOutputStream : public OutputStream
+class BEAST_API FileOutputStream
+ : public OutputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -107,8 +109,6 @@ private:
bool flushBuffer();
int64 setPositionInternal (int64);
ssize_t writeInternal (const void*, size_t);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileOutputStream)
};
#endif // BEAST_FILEOUTPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/files/beast_FileSearchPath.h b/Subtrees/beast/modules/beast_core/files/beast_FileSearchPath.h
index 334b0a94de..bb6906af36 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_FileSearchPath.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_FileSearchPath.h
@@ -34,7 +34,7 @@
@see File
*/
-class BEAST_API FileSearchPath
+class BEAST_API FileSearchPath : LeakChecked
{
public:
//==============================================================================
@@ -157,8 +157,6 @@ private:
StringArray directories;
void init (const String& path);
-
- BEAST_LEAK_DETECTOR (FileSearchPath)
};
#endif // BEAST_FILESEARCHPATH_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/files/beast_MemoryMappedFile.h b/Subtrees/beast/modules/beast_core/files/beast_MemoryMappedFile.h
index 0c20619b8a..56b6579148 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_MemoryMappedFile.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_MemoryMappedFile.h
@@ -30,7 +30,7 @@
/**
Maps a file into virtual memory for easy reading and/or writing.
*/
-class BEAST_API MemoryMappedFile
+class BEAST_API MemoryMappedFile : LeakChecked , Uncopyable
{
public:
/** The read/write flags used when opening a memory mapped file. */
@@ -103,8 +103,6 @@ private:
#endif
void openInternal (const File&, AccessMode);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryMappedFile)
};
diff --git a/Subtrees/beast/modules/beast_core/files/beast_TemporaryFile.h b/Subtrees/beast/modules/beast_core/files/beast_TemporaryFile.h
index bdc9a67284..b46371b482 100644
--- a/Subtrees/beast/modules/beast_core/files/beast_TemporaryFile.h
+++ b/Subtrees/beast/modules/beast_core/files/beast_TemporaryFile.h
@@ -65,7 +65,7 @@
@see File, FileOutputStream
*/
-class BEAST_API TemporaryFile
+class BEAST_API TemporaryFile : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -159,8 +159,6 @@ public:
private:
//==============================================================================
const File temporaryFile, targetFile;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TemporaryFile)
};
#endif // BEAST_TEMPORARYFILE_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/logging/beast_FileLogger.h b/Subtrees/beast/modules/beast_core/logging/beast_FileLogger.h
index be3ae39963..d6cb1c6020 100644
--- a/Subtrees/beast/modules/beast_core/logging/beast_FileLogger.h
+++ b/Subtrees/beast/modules/beast_core/logging/beast_FileLogger.h
@@ -35,7 +35,10 @@
@see Logger
*/
-class BEAST_API FileLogger : public Logger
+class BEAST_API FileLogger
+ : public Logger
+ , LeakChecked
+ , Uncopyable
{
public:
//==============================================================================
@@ -126,8 +129,6 @@ private:
CriticalSection logLock;
void trimFileSize (int64 maxFileSizeBytes) const;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileLogger)
};
diff --git a/Subtrees/beast/modules/beast_core/maths/beast_BigInteger.h b/Subtrees/beast/modules/beast_core/maths/beast_BigInteger.h
index c5737d8179..90e47728fc 100644
--- a/Subtrees/beast/modules/beast_core/maths/beast_BigInteger.h
+++ b/Subtrees/beast/modules/beast_core/maths/beast_BigInteger.h
@@ -39,7 +39,7 @@ class MemoryBlock;
Negative values are possible, but the value isn't stored as 2s-complement, so
be careful if you use negative values and look at the values of individual bits.
*/
-class BEAST_API BigInteger
+class BEAST_API BigInteger : LeakChecked
{
public:
//==============================================================================
@@ -312,8 +312,6 @@ private:
void ensureSize (size_t numVals);
void shiftLeft (int bits, int startBit);
void shiftRight (int bits, int startBit);
-
- BEAST_LEAK_DETECTOR (BigInteger)
};
/** Writes a BigInteger to an OutputStream as a UTF8 decimal string. */
diff --git a/Subtrees/beast/modules/beast_core/maths/beast_Expression.cpp b/Subtrees/beast/modules/beast_core/maths/beast_Expression.cpp
index d0b1c29403..5c3dd36915 100644
--- a/Subtrees/beast/modules/beast_core/maths/beast_Expression.cpp
+++ b/Subtrees/beast/modules/beast_core/maths/beast_Expression.cpp
@@ -21,7 +21,8 @@
*/
//==============================================================================
-class Expression::Term : public SingleThreadedReferenceCountedObject
+class Expression::Term
+ : public SingleThreadedReferenceCountedObject
{
public:
Term() {}
@@ -69,9 +70,6 @@ public:
for (int i = getNumInputs(); --i >= 0;)
getInput(i)->visitAllSymbols (visitor, scope, recursionDepth);
}
-
-private:
- BEAST_DECLARE_NON_COPYABLE (Term)
};
@@ -295,7 +293,8 @@ struct Expression::Helpers
};
//==============================================================================
- class DotOperator : public BinaryTerm
+ class DotOperator
+ : public BinaryTerm
{
public:
DotOperator (SymbolTerm* const l, Term* const r) : BinaryTerm (l, r) {}
@@ -345,7 +344,9 @@ struct Expression::Helpers
private:
//==============================================================================
- class EvaluationVisitor : public Scope::Visitor
+ class EvaluationVisitor
+ : public Scope::Visitor
+ , Uncopyable
{
public:
EvaluationVisitor (const TermPtr& t, const int recursion)
@@ -356,12 +357,11 @@ struct Expression::Helpers
const TermPtr input;
TermPtr output;
const int recursionCount;
-
- private:
- BEAST_DECLARE_NON_COPYABLE (EvaluationVisitor)
};
- class SymbolVisitingVisitor : public Scope::Visitor
+ class SymbolVisitingVisitor
+ : public Scope::Visitor
+ , Uncopyable
{
public:
SymbolVisitingVisitor (const TermPtr& t, SymbolVisitor& v, const int recursion)
@@ -373,11 +373,11 @@ struct Expression::Helpers
const TermPtr input;
SymbolVisitor& visitor;
const int recursionCount;
-
- BEAST_DECLARE_NON_COPYABLE (SymbolVisitingVisitor)
};
- class SymbolRenamingVisitor : public Scope::Visitor
+ class SymbolRenamingVisitor
+ : public Scope::Visitor
+ , Uncopyable
{
public:
SymbolRenamingVisitor (const TermPtr& t, const Expression::Symbol& symbol_, const String& newName_, const int recursionCount_)
@@ -390,13 +390,9 @@ struct Expression::Helpers
const Symbol& symbol;
const String newName;
const int recursionCount;
-
- BEAST_DECLARE_NON_COPYABLE (SymbolRenamingVisitor)
};
SymbolTerm* getSymbol() const { return static_cast (left.get()); }
-
- BEAST_DECLARE_NON_COPYABLE (DotOperator)
};
//==============================================================================
@@ -446,7 +442,7 @@ struct Expression::Helpers
};
//==============================================================================
- class Add : public BinaryTerm
+ class Add : public BinaryTerm
{
public:
Add (Term* const l, Term* const r) : BinaryTerm (l, r) {}
@@ -465,13 +461,10 @@ struct Expression::Helpers
return new Subtract (newDest, (input == left ? right : left)->clone());
}
-
- private:
- BEAST_DECLARE_NON_COPYABLE (Add)
};
//==============================================================================
- class Subtract : public BinaryTerm
+ class Subtract : public BinaryTerm
{
public:
Subtract (Term* const l, Term* const r) : BinaryTerm (l, r) {}
@@ -493,13 +486,10 @@ struct Expression::Helpers
return new Subtract (left->clone(), newDest);
}
-
- private:
- BEAST_DECLARE_NON_COPYABLE (Subtract)
};
//==============================================================================
- class Multiply : public BinaryTerm
+ class Multiply : public BinaryTerm
{
public:
Multiply (Term* const l, Term* const r) : BinaryTerm (l, r) {}
@@ -518,13 +508,10 @@ struct Expression::Helpers
return new Divide (newDest, (input == left ? right : left)->clone());
}
-
- private:
- BEAST_DECLARE_NON_COPYABLE (Multiply)
};
//==============================================================================
- class Divide : public BinaryTerm
+ class Divide : public BinaryTerm
{
public:
Divide (Term* const l, Term* const r) : BinaryTerm (l, r) {}
@@ -546,9 +533,6 @@ struct Expression::Helpers
return new Divide (left->clone(), newDest);
}
-
- private:
- BEAST_DECLARE_NON_COPYABLE (Divide)
};
//==============================================================================
@@ -621,7 +605,9 @@ struct Expression::Helpers
}
//==============================================================================
- class SymbolCheckVisitor : public Term::SymbolVisitor
+ class SymbolCheckVisitor
+ : public Term::SymbolVisitor
+ , Uncopyable
{
public:
SymbolCheckVisitor (const Symbol& symbol_) : wasFound (false), symbol (symbol_) {}
@@ -631,12 +617,12 @@ struct Expression::Helpers
private:
const Symbol& symbol;
-
- BEAST_DECLARE_NON_COPYABLE (SymbolCheckVisitor)
};
//==============================================================================
- class SymbolListVisitor : public Term::SymbolVisitor
+ class SymbolListVisitor
+ : public Term::SymbolVisitor
+ , Uncopyable
{
public:
SymbolListVisitor (Array& list_) : list (list_) {}
@@ -644,12 +630,10 @@ struct Expression::Helpers
private:
Array& list;
-
- BEAST_DECLARE_NON_COPYABLE (SymbolListVisitor)
};
//==============================================================================
- class Parser
+ class Parser : Uncopyable
{
public:
//==============================================================================
@@ -908,8 +892,6 @@ struct Expression::Helpers
return e;
}
-
- BEAST_DECLARE_NON_COPYABLE (Parser)
};
};
diff --git a/Subtrees/beast/modules/beast_core/maths/beast_Random.h b/Subtrees/beast/modules/beast_core/maths/beast_Random.h
index cf9ce61613..f35c0eed92 100644
--- a/Subtrees/beast/modules/beast_core/maths/beast_Random.h
+++ b/Subtrees/beast/modules/beast_core/maths/beast_Random.h
@@ -33,7 +33,7 @@
You can create a Random object and use it to generate a sequence of random numbers.
*/
-class BEAST_API Random
+class BEAST_API Random : LeakChecked
{
public:
//==============================================================================
@@ -127,8 +127,6 @@ public:
private:
//==============================================================================
int64 seed;
-
- BEAST_LEAK_DETECTOR (Random)
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_ByteOrder.h b/Subtrees/beast/modules/beast_core/memory/beast_ByteOrder.h
index 0d41fe2266..b02eedf9d6 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_ByteOrder.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_ByteOrder.h
@@ -29,7 +29,7 @@
/** Contains static methods for converting the byte order between different
endiannesses.
*/
-class BEAST_API ByteOrder
+class BEAST_API ByteOrder : Uncopyable
{
public:
//==============================================================================
@@ -93,8 +93,6 @@ public:
private:
ByteOrder();
-
- BEAST_DECLARE_NON_COPYABLE (ByteOrder)
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_HeapBlock.h b/Subtrees/beast/modules/beast_core/memory/beast_HeapBlock.h
index 4badf561c2..074d3ecad2 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_HeapBlock.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_HeapBlock.h
@@ -82,7 +82,7 @@ namespace HeapBlockHelper
@see Array, OwnedArray, MemoryBlock
*/
template
-class HeapBlock
+class HeapBlock : Uncopyable
{
public:
//==============================================================================
@@ -294,7 +294,6 @@ private:
}
#if ! (defined (BEAST_DLL) || defined (BEAST_DLL_BUILD))
- BEAST_DECLARE_NON_COPYABLE (HeapBlock)
BEAST_PREVENT_HEAP_ALLOCATION // Creating a 'new HeapBlock' would be missing the point!
#endif
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_LeakedObjectDetector.h b/Subtrees/beast/modules/beast_core/memory/beast_LeakedObjectDetector.h
deleted file mode 100644
index cc45e61dc7..0000000000
--- a/Subtrees/beast/modules/beast_core/memory/beast_LeakedObjectDetector.h
+++ /dev/null
@@ -1,144 +0,0 @@
-//------------------------------------------------------------------------------
-/*
- This file is part of Beast: https://github.com/vinniefalco/Beast
- Copyright 2013, Vinnie Falco
-
- Portions of this file are from JUCE.
- Copyright (c) 2013 - Raw Material Software Ltd.
- Please visit http://www.juce.com
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-//==============================================================================
-
-#ifndef BEAST_LEAKEDOBJECTDETECTOR_BEASTHEADER
-#define BEAST_LEAKEDOBJECTDETECTOR_BEASTHEADER
-
-#include "../text/beast_String.h"
-#include "beast_Atomic.h"
-
-
-//==============================================================================
-/**
- Embedding an instance of this class inside another class can be used as a low-overhead
- way of detecting leaked instances.
-
- This class keeps an internal static count of the number of instances that are
- active, so that when the app is shutdown and the static destructors are called,
- it can check whether there are any left-over instances that may have been leaked.
-
- To use it, use the BEAST_LEAK_DETECTOR macro as a simple way to put one in your
- class declaration. Have a look through the beast codebase for examples, it's used
- in most of the classes.
-*/
-template
-class LeakedObjectDetector
-{
-public:
- //==============================================================================
- LeakedObjectDetector() noexcept { ++(getCounter().numObjects); }
- LeakedObjectDetector (const LeakedObjectDetector&) noexcept { ++(getCounter().numObjects); }
-
- ~LeakedObjectDetector()
- {
- if (--(getCounter().numObjects) < 0)
- {
- DBG ("*** Dangling pointer deletion! Class: " << getLeakedObjectClassName());
-
- /** If you hit this, then you've managed to delete more instances of this class than you've
- created.. That indicates that you're deleting some dangling pointers.
-
- Note that although this assertion will have been triggered during a destructor, it might
- not be this particular deletion that's at fault - the incorrect one may have happened
- at an earlier point in the program, and simply not been detected until now.
-
- Most errors like this are caused by using old-fashioned, non-RAII techniques for
- your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays,
- ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs!
- */
- bassertfalse;
- }
- }
-
-private:
- //==============================================================================
- class LeakCounter
- {
- public:
- LeakCounter() noexcept {}
-
- ~LeakCounter()
- {
- if (numObjects.value > 0)
- {
- DBG ("*** Leaked objects detected: " << numObjects.value << " instance(s) of class " << getLeakedObjectClassName());
-
- /** If you hit this, then you've leaked one or more objects of the type specified by
- the 'OwnerClass' template parameter - the name should have been printed by the line above.
-
- If you're leaking, it's probably because you're using old-fashioned, non-RAII techniques for
- your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays,
- ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs!
- */
- //bassertfalse;
- }
- }
-
- Atomic numObjects;
- };
-
- static const char* getLeakedObjectClassName()
- {
- return OwnerClass::getLeakedObjectClassName();
- }
-
- static LeakCounter& getCounter() noexcept
- {
- static LeakCounter counter;
- return counter;
- }
-};
-
-//==============================================================================
-#if DOXYGEN || ! defined (BEAST_LEAK_DETECTOR)
- #if (DOXYGEN || BEAST_CHECK_MEMORY_LEAKS)
- /** This macro lets you embed a leak-detecting object inside a class.
-
- To use it, simply declare a BEAST_LEAK_DETECTOR(YourClassName) inside a private section
- of the class declaration. E.g.
-
- @code
- class MyClass
- {
- public:
- MyClass();
- void blahBlah();
-
- private:
- BEAST_LEAK_DETECTOR (MyClass)
- };
- @endcode
-
- @see BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR, LeakedObjectDetector
- */
- #define BEAST_LEAK_DETECTOR(OwnerClass) \
- friend class beast::LeakedObjectDetector; \
- static const char* getLeakedObjectClassName() noexcept { return #OwnerClass; } \
- beast::LeakedObjectDetector BEAST_JOIN_MACRO (leakDetector, __LINE__);
- #else
- #define BEAST_LEAK_DETECTOR(OwnerClass)
- #endif
-#endif
-
-
-#endif // BEAST_LEAKEDOBJECTDETECTOR_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_Memory.h b/Subtrees/beast/modules/beast_core/memory/beast_Memory.h
index 68def8bd8e..092113cd7a 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_Memory.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_Memory.h
@@ -65,7 +65,7 @@ inline Type* createCopyIfNotNull (const Type* pointer) { return pointer != n
/** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object using RAII.
You should use the BEAST_AUTORELEASEPOOL macro to create a local auto-release pool on the stack.
*/
- class BEAST_API ScopedAutoReleasePool
+ class BEAST_API ScopedAutoReleasePool : Uncopyable
{
public:
ScopedAutoReleasePool();
@@ -73,8 +73,6 @@ inline Type* createCopyIfNotNull (const Type* pointer) { return pointer != n
private:
void* pool;
-
- BEAST_DECLARE_NON_COPYABLE (ScopedAutoReleasePool)
};
/** A macro that can be used to easily declare a local ScopedAutoReleasePool
@@ -92,30 +90,5 @@ inline Type* createCopyIfNotNull (const Type* pointer) { return pointer != n
#define BEAST_AUTORELEASEPOOL
#endif
-//==============================================================================
-/* In a Windows DLL build, we'll expose some malloc/free functions that live inside the DLL, and use these for
- allocating all the objects - that way all beast objects in the DLL and in the host will live in the same heap,
- avoiding problems when an object is created in one module and passed across to another where it is deleted.
- By piggy-backing on the BEAST_LEAK_DETECTOR macro, these allocators can be injected into most beast classes.
-*/
-#if BEAST_MSVC && (defined (BEAST_DLL) || defined (BEAST_DLL_BUILD)) && ! (BEAST_DISABLE_DLL_ALLOCATORS || DOXYGEN)
- extern BEAST_API void* beastDLL_malloc (size_t);
- extern BEAST_API void beastDLL_free (void*);
-
- #define BEAST_LEAK_DETECTOR(OwnerClass) public:\
- static void* operator new (size_t sz) { return beast::beastDLL_malloc (sz); } \
- static void* operator new (size_t, void* p) { return p; } \
- static void operator delete (void* p) { beast::beastDLL_free (p); } \
- static void operator delete (void*, void*) {}
#endif
-//==============================================================================
-/** (Deprecated) This was a Windows-specific way of checking for object leaks - now please
- use the BEAST_LEAK_DETECTOR instead.
-*/
-#ifndef beast_UseDebuggingNewOperator
- #define beast_UseDebuggingNewOperator
-#endif
-
-
-#endif // BEAST_MEMORY_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h b/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h
index 54107a4b0f..103f885ac0 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_MemoryBlock.h
@@ -33,7 +33,7 @@
A class to hold a resizable block of raw data.
*/
-class BEAST_API MemoryBlock
+class BEAST_API MemoryBlock : LeakChecked
{
public:
//==============================================================================
@@ -247,8 +247,6 @@ private:
HeapBlock data;
size_t size;
static const char* const encodingTable;
-
- BEAST_LEAK_DETECTOR (MemoryBlock)
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_ReferenceCountedObject.h b/Subtrees/beast/modules/beast_core/memory/beast_ReferenceCountedObject.h
index fe0e02a05c..f0458ea8c8 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_ReferenceCountedObject.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_ReferenceCountedObject.h
@@ -59,7 +59,7 @@
@see ReferenceCountedObjectPtr, ReferenceCountedArray, SingleThreadedReferenceCountedObject
*/
-class BEAST_API ReferenceCountedObject
+class BEAST_API ReferenceCountedObject : Uncopyable
{
public:
//==============================================================================
@@ -114,8 +114,6 @@ protected:
private:
//==============================================================================
Atomic refCount;
-
- BEAST_DECLARE_NON_COPYABLE (ReferenceCountedObject)
};
@@ -130,7 +128,7 @@ private:
@see ReferenceCountedObject, ReferenceCountedObjectPtr, ReferenceCountedArray
*/
-class BEAST_API SingleThreadedReferenceCountedObject
+class BEAST_API SingleThreadedReferenceCountedObject : public Uncopyable
{
public:
//==============================================================================
@@ -175,8 +173,6 @@ protected:
private:
//==============================================================================
int refCount;
-
- BEAST_DECLARE_NON_COPYABLE (SingleThreadedReferenceCountedObject)
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_ScopedPointer.h b/Subtrees/beast/modules/beast_core/memory/beast_ScopedPointer.h
index f07b7f2929..e0bb516d29 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_ScopedPointer.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_ScopedPointer.h
@@ -62,7 +62,7 @@
you'd need to return a raw pointer (or use a std::auto_ptr instead).
*/
template
-class ScopedPointer
+class ScopedPointer : Uncopyable
{
public:
//==============================================================================
@@ -215,7 +215,6 @@ private:
It's probably best to use the latter form when writing your object declarations anyway, as
this is a better representation of the code that you actually want the compiler to produce.
*/
- BEAST_DECLARE_NON_COPYABLE (ScopedPointer)
#endif
};
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h b/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h
index b38cc852aa..d1533bee38 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h
@@ -120,26 +120,19 @@ char Storage ::s_storage [sizeof (ObjectType)];
class Initializer
{
public:
- /*
- bool inited () const
- {
- return m_state.get () == stateInitialized;
- }
- */
-
// If the condition is not initialized, the first caller will
// receive true, while concurrent callers get blocked until
// initialization completes.
//
- bool begin ()
+ bool beginConstruction ()
{
- bool shouldInitialize;
+ bool needsInitialization = false;
- if (m_state.get () == stateUninitialized)
+ if (m_state.get () != stateInitialized)
{
if (m_state.compareAndSetBool (stateInitializing, stateUninitialized))
{
- shouldInitialize = true;
+ needsInitialization = true;
}
else
{
@@ -150,21 +143,15 @@ public:
delay.pause ();
}
while (m_state.get () != stateInitialized);
-
- shouldInitialize = false;
}
}
- else
- {
- shouldInitialize = false;
- }
- return shouldInitialize;
+ return needsInitialization;
}
// Called to signal that the initialization is complete
//
- void end ()
+ void endConstruction ()
{
m_state.set (stateInitialized);
}
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h b/Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h
index 0ce3c4fa2b..e1f1a614b1 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h
@@ -20,10 +20,39 @@
#ifndef BEAST_UNCOPYABLE_BEASTHEADER
#define BEAST_UNCOPYABLE_BEASTHEADER
-// Prevents warnings about missing copy
-// constructors and assignment operators.
+/** Prevent copy construction and assignment.
-// Ideas based on boost
+ This is used to suppress warnings and prevent unsafe operations on
+ objects which cannot be passed by value. Ideas based on Boost.
+
+ For example, instead of
+
+ @code
+
+ class MyClass
+ {
+ public:
+ //...
+
+ private:
+ MyClass (const MyClass&);
+ MyClass& operator= (const MyClass&);
+ };
+
+ @endcode
+
+ ..you can just write:
+
+ @code
+
+ class MyClass : Uncopyable
+ {
+ public:
+ //...
+ };
+
+ @endcode
+*/
class Uncopyable
{
protected:
diff --git a/Subtrees/beast/modules/beast_core/memory/beast_WeakReference.h b/Subtrees/beast/modules/beast_core/memory/beast_WeakReference.h
index 192ef1a623..42d396c70f 100644
--- a/Subtrees/beast/modules/beast_core/memory/beast_WeakReference.h
+++ b/Subtrees/beast/modules/beast_core/memory/beast_WeakReference.h
@@ -128,7 +128,9 @@ public:
in your code!
@see WeakReference
*/
- class SharedPointer : public ReferenceCountingType
+ class SharedPointer
+ : public ReferenceCountingType
+ , Uncopyable
{
public:
explicit SharedPointer (ObjectType* const obj) noexcept : owner (obj) {}
@@ -138,8 +140,6 @@ public:
private:
ObjectType* volatile owner;
-
- BEAST_DECLARE_NON_COPYABLE (SharedPointer)
};
typedef ReferenceCountedObjectPtr SharedRef;
@@ -150,7 +150,7 @@ public:
See the WeakReference class notes for an example of how to use this class.
@see WeakReference
*/
- class Master
+ class Master : Uncopyable
{
public:
Master() noexcept {}
@@ -192,8 +192,6 @@ public:
private:
SharedRef sharedPointer;
-
- BEAST_DECLARE_NON_COPYABLE (Master)
};
private:
diff --git a/Subtrees/beast/modules/beast_core/misc/beast_Uuid.h b/Subtrees/beast/modules/beast_core/misc/beast_Uuid.h
index 33f4524c0d..358b8ce444 100644
--- a/Subtrees/beast/modules/beast_core/misc/beast_Uuid.h
+++ b/Subtrees/beast/modules/beast_core/misc/beast_Uuid.h
@@ -37,7 +37,7 @@
The class includes methods for saving the ID as a string or as raw binary data.
*/
-class BEAST_API Uuid
+class BEAST_API Uuid : LeakChecked
{
public:
//==============================================================================
@@ -101,8 +101,6 @@ public:
private:
//==============================================================================
uint8 uuid[16];
-
- BEAST_LEAK_DETECTOR (Uuid)
};
diff --git a/Subtrees/beast/modules/beast_core/misc/beast_WindowsRegistry.h b/Subtrees/beast/modules/beast_core/misc/beast_WindowsRegistry.h
index e1c1f811d8..86b95cd246 100644
--- a/Subtrees/beast/modules/beast_core/misc/beast_WindowsRegistry.h
+++ b/Subtrees/beast/modules/beast_core/misc/beast_WindowsRegistry.h
@@ -30,7 +30,7 @@
Contains some static helper functions for manipulating the MS Windows registry
(Only available on Windows, of course!)
*/
-class WindowsRegistry
+class WindowsRegistry : Uncopyable
{
public:
//==============================================================================
@@ -112,7 +112,6 @@ public:
private:
WindowsRegistry();
- BEAST_DECLARE_NON_COPYABLE (WindowsRegistry)
};
#endif
diff --git a/Subtrees/beast/modules/beast_core/native/beast_android_Files.cpp b/Subtrees/beast/modules/beast_core/native/beast_android_Files.cpp
index ed53676ac8..51d57f85e2 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_android_Files.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_android_Files.cpp
@@ -148,7 +148,7 @@ bool File::moveToTrash() const
}
//==============================================================================
-class DirectoryIterator::NativeIterator::Pimpl
+class DirectoryIterator::NativeIterator::Pimpl : Uncopyable
{
public:
Pimpl (const File& directory, const String& wildCard_)
@@ -202,8 +202,6 @@ public:
private:
String parentDir, wildCard;
DIR* dir;
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
diff --git a/Subtrees/beast/modules/beast_core/native/beast_android_JNIHelpers.h b/Subtrees/beast/modules/beast_core/native/beast_android_JNIHelpers.h
index 3681c5c6a4..4393f17fa5 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_android_JNIHelpers.h
+++ b/Subtrees/beast/modules/beast_core/native/beast_android_JNIHelpers.h
@@ -167,7 +167,7 @@ namespace
}
//==============================================================================
-class JNIClassBase
+class JNIClassBase : Uncopyable
{
public:
explicit JNIClassBase (const char* classPath);
@@ -193,8 +193,6 @@ private:
static Array& getClasses();
void initialise (JNIEnv*);
void release (JNIEnv*);
-
- BEAST_DECLARE_NON_COPYABLE (JNIClassBase)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/native/beast_android_Network.cpp b/Subtrees/beast/modules/beast_core/native/beast_android_Network.cpp
index 6fdd4f6339..460268d683 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_android_Network.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_android_Network.cpp
@@ -60,7 +60,10 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress,
//==============================================================================
-class WebInputStream : public InputStream
+class WebInputStream
+ : public InputStream
+ , LeakChecked
+ , Uncopyable
{
public:
//==============================================================================
@@ -154,9 +157,6 @@ public:
//==============================================================================
GlobalRef stream;
-
-private:
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)
};
InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData,
diff --git a/Subtrees/beast/modules/beast_core/native/beast_bsd_Files.cpp b/Subtrees/beast/modules/beast_core/native/beast_bsd_Files.cpp
index 6487f80fb3..7f8c1eef03 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_bsd_Files.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_bsd_Files.cpp
@@ -241,7 +241,7 @@ bool File::moveToTrash() const
}
//==============================================================================
-class DirectoryIterator::NativeIterator::Pimpl
+class DirectoryIterator::NativeIterator::Pimpl : Uncopyable
{
public:
Pimpl (const File& directory, const String& wildCard_)
@@ -295,8 +295,6 @@ public:
private:
String parentDir, wildCard;
DIR* dir;
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildCard)
diff --git a/Subtrees/beast/modules/beast_core/native/beast_bsd_Network.cpp b/Subtrees/beast/modules/beast_core/native/beast_bsd_Network.cpp
index 18620f679f..45167cd463 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_bsd_Network.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_bsd_Network.cpp
@@ -60,7 +60,9 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */,
//==============================================================================
-class WebInputStream : public InputStream
+class WebInputStream
+ : public InputStream
+ , LeakChecked
{
public:
WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_,
@@ -439,8 +441,6 @@ private:
return String::empty;
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)
};
InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData,
diff --git a/Subtrees/beast/modules/beast_core/native/beast_linux_Files.cpp b/Subtrees/beast/modules/beast_core/native/beast_linux_Files.cpp
index 6487f80fb3..7f8c1eef03 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_linux_Files.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_linux_Files.cpp
@@ -241,7 +241,7 @@ bool File::moveToTrash() const
}
//==============================================================================
-class DirectoryIterator::NativeIterator::Pimpl
+class DirectoryIterator::NativeIterator::Pimpl : Uncopyable
{
public:
Pimpl (const File& directory, const String& wildCard_)
@@ -295,8 +295,6 @@ public:
private:
String parentDir, wildCard;
DIR* dir;
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildCard)
diff --git a/Subtrees/beast/modules/beast_core/native/beast_linux_Network.cpp b/Subtrees/beast/modules/beast_core/native/beast_linux_Network.cpp
index 33b8012e7d..69677f6db4 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_linux_Network.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_linux_Network.cpp
@@ -62,7 +62,10 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */,
//==============================================================================
-class WebInputStream : public InputStream
+class WebInputStream
+ : public InputStream
+ , LeakChecked
+ , Uncopyable
{
public:
WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_,
@@ -441,8 +444,6 @@ private:
return String::empty;
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)
};
InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData,
diff --git a/Subtrees/beast/modules/beast_core/native/beast_mac_Files.mm b/Subtrees/beast/modules/beast_core/native/beast_mac_Files.mm
index 020a06514c..09b55030eb 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_mac_Files.mm
+++ b/Subtrees/beast/modules/beast_core/native/beast_mac_Files.mm
@@ -308,7 +308,7 @@ bool File::moveToTrash() const
}
//==============================================================================
-class DirectoryIterator::NativeIterator::Pimpl
+class DirectoryIterator::NativeIterator::Pimpl : Uncopyable
{
public:
Pimpl (const File& directory, const String& wildCard_)
@@ -364,8 +364,6 @@ public:
private:
String parentDir, wildCard;
NSDirectoryEnumerator* enumerator;
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildcard)
diff --git a/Subtrees/beast/modules/beast_core/native/beast_mac_Network.mm b/Subtrees/beast/modules/beast_core/native/beast_mac_Network.mm
index ddba3b886e..3893bfd5aa 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_mac_Network.mm
+++ b/Subtrees/beast/modules/beast_core/native/beast_mac_Network.mm
@@ -97,7 +97,10 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress,
}
//==============================================================================
-class URLConnectionState : public Thread
+class URLConnectionState
+ : public Thread
+ , LeakChecked
+ , Uncopyable
{
public:
URLConnectionState (NSURLRequest* req)
@@ -290,13 +293,14 @@ private:
getState (self)->finishedLoading();
}
};
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (URLConnectionState)
};
//==============================================================================
-class WebInputStream : public InputStream
+class WebInputStream
+ : public InputStream
+ , LeakChecked
+ , Uncopyable
{
public:
WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_,
@@ -411,8 +415,6 @@ private:
connection = nullptr;
}
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)
};
InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData,
diff --git a/Subtrees/beast/modules/beast_core/native/beast_osx_ObjCHelpers.h b/Subtrees/beast/modules/beast_core/native/beast_osx_ObjCHelpers.h
index d565e9d845..1f0c10e2e6 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_osx_ObjCHelpers.h
+++ b/Subtrees/beast/modules/beast_core/native/beast_osx_ObjCHelpers.h
@@ -64,7 +64,7 @@ struct NSObjectRetainer
//==============================================================================
template
-struct ObjCClass
+struct ObjCClass : Uncopyable
{
ObjCClass (const char* nameRoot)
: cls (objc_allocateClassPair ([SuperclassType class], getRandomisedName (nameRoot).toUTF8(), 0))
@@ -145,8 +145,6 @@ private:
{
return root + String::toHexString (beast::Random::getSystemRandom().nextInt64());
}
-
- BEAST_DECLARE_NON_COPYABLE (ObjCClass)
};
diff --git a/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp b/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp
index ed5a6b1f0a..a43ada5a12 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_posix_NamedPipe.cpp
@@ -21,7 +21,7 @@
*/
//==============================================================================
-class NamedPipe::Pimpl
+class NamedPipe::Pimpl : LeakChecked , Uncopyable
{
public:
Pimpl (const String& pipePath, bool createPipe)
@@ -164,8 +164,6 @@ private:
select (handle + 1, &rset, nullptr, 0, &timeout);
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)
};
void NamedPipe::close()
diff --git a/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h b/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h
index 3f554025c2..6ba80516a9 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h
+++ b/Subtrees/beast/modules/beast_core/native/beast_posix_SharedCode.h
@@ -973,7 +973,7 @@ void* DynamicLibrary::getFunction (const String& functionName) noexcept
//==============================================================================
-class ChildProcess::ActiveProcess
+class ChildProcess::ActiveProcess : LeakChecked , Uncopyable
{
public:
ActiveProcess (const StringArray& arguments)
@@ -1066,8 +1066,6 @@ public:
private:
int pipeHandle;
FILE* readHandle;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ActiveProcess)
};
bool ChildProcess::start (const String& command)
@@ -1104,7 +1102,7 @@ bool ChildProcess::kill()
}
//==============================================================================
-struct HighResolutionTimer::Pimpl
+struct HighResolutionTimer::Pimpl : Uncopyable
{
Pimpl (HighResolutionTimer& t) : owner (t), thread (0), shouldStop (false)
{
@@ -1250,6 +1248,4 @@ private:
#endif
}
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
diff --git a/Subtrees/beast/modules/beast_core/native/beast_win32_Files.cpp b/Subtrees/beast/modules/beast_core/native/beast_win32_Files.cpp
index 56f17582f5..a15fdb6b62 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_win32_Files.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_win32_Files.cpp
@@ -628,6 +628,8 @@ bool File::createLink (const String& description, const File& linkFileToCreate)
//==============================================================================
class DirectoryIterator::NativeIterator::Pimpl
+ : LeakChecked
+ , Uncopyable
{
public:
Pimpl (const File& directory, const String& wildCard)
@@ -677,8 +679,6 @@ public:
private:
const String directoryWithWildCard;
HANDLE handle;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)
};
DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildCard)
@@ -731,7 +731,7 @@ void File::revealToUser() const
}
//==============================================================================
-class NamedPipe::Pimpl
+class NamedPipe::Pimpl : LeakChecked , Uncopyable
{
public:
Pimpl (const String& pipeName, const bool createPipe)
@@ -914,8 +914,6 @@ private:
CancelIo (pipeH);
return false;
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)
};
void NamedPipe::close()
diff --git a/Subtrees/beast/modules/beast_core/native/beast_win32_Network.cpp b/Subtrees/beast/modules/beast_core/native/beast_win32_Network.cpp
index 7edad70888..f239d190c7 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_win32_Network.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_win32_Network.cpp
@@ -30,7 +30,9 @@
#endif
//==============================================================================
-class WebInputStream : public InputStream
+class WebInputStream
+ : public InputStream
+ , LeakChecked
{
public:
WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_,
@@ -296,8 +298,6 @@ private:
close();
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)
};
InputStream* URL::createNativeStream (const String& address, bool isPost, const MemoryBlock& postData,
diff --git a/Subtrees/beast/modules/beast_core/native/beast_win32_Registry.cpp b/Subtrees/beast/modules/beast_core/native/beast_win32_Registry.cpp
index adc7599c9a..af37aaa93a 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_win32_Registry.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_win32_Registry.cpp
@@ -21,7 +21,7 @@
*/
//==============================================================================
-struct RegistryKeyWrapper
+struct RegistryKeyWrapper : Uncopyable
{
RegistryKeyWrapper (String name, const bool createForWriting, const DWORD wow64Flags)
: key (0), wideCharValueName (nullptr)
@@ -130,8 +130,6 @@ struct RegistryKeyWrapper
HKEY key;
const wchar_t* wideCharValueName;
String valueName;
-
- BEAST_DECLARE_NON_COPYABLE (RegistryKeyWrapper)
};
uint32 WindowsRegistry::getBinaryValue (const String& regValuePath, MemoryBlock& result)
diff --git a/Subtrees/beast/modules/beast_core/native/beast_win32_Threads.cpp b/Subtrees/beast/modules/beast_core/native/beast_win32_Threads.cpp
index 937069576a..6c9f455a77 100644
--- a/Subtrees/beast/modules/beast_core/native/beast_win32_Threads.cpp
+++ b/Subtrees/beast/modules/beast_core/native/beast_win32_Threads.cpp
@@ -459,7 +459,7 @@ void InterProcessLock::exit()
}
//==============================================================================
-class ChildProcess::ActiveProcess
+class ChildProcess::ActiveProcess : LeakChecked , Uncopyable
{
public:
ActiveProcess (const String& command)
@@ -549,8 +549,6 @@ public:
private:
HANDLE readPipe, writePipe;
PROCESS_INFORMATION processInfo;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ActiveProcess)
};
bool ChildProcess::start (const String& command)
@@ -584,7 +582,7 @@ bool ChildProcess::kill()
}
//==============================================================================
-struct HighResolutionTimer::Pimpl
+struct HighResolutionTimer::Pimpl : Uncopyable
{
Pimpl (HighResolutionTimer& t) noexcept : owner (t), periodMs (0)
{
@@ -631,6 +629,4 @@ private:
if (timer->periodMs != 0)
timer->owner.hiResTimerCallback();
}
-
- BEAST_DECLARE_NON_COPYABLE (Pimpl)
};
diff --git a/Subtrees/beast/modules/beast_core/network/beast_NamedPipe.h b/Subtrees/beast/modules/beast_core/network/beast_NamedPipe.h
index ae9c24c5ff..3e73e09ecc 100644
--- a/Subtrees/beast/modules/beast_core/network/beast_NamedPipe.h
+++ b/Subtrees/beast/modules/beast_core/network/beast_NamedPipe.h
@@ -34,7 +34,7 @@
@see InterprocessConnection
*/
-class BEAST_API NamedPipe
+class BEAST_API NamedPipe : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -92,8 +92,6 @@ private:
ReadWriteLock lock;
bool openInternal (const String& pipeName, const bool createPipe);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NamedPipe)
};
diff --git a/Subtrees/beast/modules/beast_core/network/beast_Socket.h b/Subtrees/beast/modules/beast_core/network/beast_Socket.h
index 91db75fe83..3b526f6f4e 100644
--- a/Subtrees/beast/modules/beast_core/network/beast_Socket.h
+++ b/Subtrees/beast/modules/beast_core/network/beast_Socket.h
@@ -36,7 +36,7 @@
@see DatagramSocket, InterprocessConnection, InterprocessConnectionServer
*/
-class BEAST_API StreamingSocket
+class BEAST_API StreamingSocket : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -163,8 +163,6 @@ private:
bool connected, isListener;
StreamingSocket (const String& hostname, int portNumber, int handle);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StreamingSocket)
};
@@ -177,7 +175,7 @@ private:
@see StreamingSocket, InterprocessConnection, InterprocessConnectionServer
*/
-class BEAST_API DatagramSocket
+class BEAST_API DatagramSocket : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -294,8 +292,6 @@ private:
void* serverAddress;
DatagramSocket (const String& hostname, int portNumber, int handle, int localPortNumber);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DatagramSocket)
};
diff --git a/Subtrees/beast/modules/beast_core/network/beast_URL.h b/Subtrees/beast/modules/beast_core/network/beast_URL.h
index dd6963341f..31e14afe17 100644
--- a/Subtrees/beast/modules/beast_core/network/beast_URL.h
+++ b/Subtrees/beast/modules/beast_core/network/beast_URL.h
@@ -37,7 +37,7 @@ class XmlElement;
This class can be used to launch URLs in browsers, and also to create
InputStreams that can read from remote http or ftp sources.
*/
-class BEAST_API URL
+class BEAST_API URL : LeakChecked
{
public:
//==============================================================================
@@ -338,7 +338,6 @@ private:
OpenStreamProgressCallback* progressCallback,
void* progressCallbackContext, const String& headers,
const int timeOutMs, StringPairArray* responseHeaders);
- BEAST_LEAK_DETECTOR (URL)
};
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_BufferedInputStream.h b/Subtrees/beast/modules/beast_core/streams/beast_BufferedInputStream.h
index 54ef9668e1..c2d35440ea 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_BufferedInputStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_BufferedInputStream.h
@@ -37,7 +37,9 @@
so that the source stream gets accessed in larger chunk sizes, meaning less
work for the underlying stream.
*/
-class BEAST_API BufferedInputStream : public InputStream
+class BEAST_API BufferedInputStream
+ : public InputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -84,8 +86,6 @@ private:
int64 position, lastReadPos, bufferStart, bufferOverlap;
HeapBlock buffer;
void ensureBuffered();
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BufferedInputStream)
};
#endif // BEAST_BUFFEREDINPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_FileInputSource.h b/Subtrees/beast/modules/beast_core/streams/beast_FileInputSource.h
index 8726144f42..ff217974cc 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_FileInputSource.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_FileInputSource.h
@@ -34,7 +34,10 @@
@see InputSource
*/
-class BEAST_API FileInputSource : public InputSource
+class BEAST_API FileInputSource
+ : public InputSource
+ , LeakChecked
+ , Uncopyable
{
public:
//==============================================================================
@@ -56,8 +59,6 @@ private:
//==============================================================================
const File file;
bool useFileTimeInHashGeneration;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileInputSource)
};
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_InputSource.h b/Subtrees/beast/modules/beast_core/streams/beast_InputSource.h
index cd47a678c1..1936df3a61 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_InputSource.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_InputSource.h
@@ -35,7 +35,7 @@
@see FileInputSource
*/
-class BEAST_API InputSource
+class BEAST_API InputSource : LeakChecked
{
public:
//==============================================================================
@@ -63,11 +63,6 @@ public:
/** Returns a hash code that uniquely represents this item.
*/
virtual int64 hashCode() const = 0;
-
-
-private:
- //==============================================================================
- BEAST_LEAK_DETECTOR (InputSource)
};
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_InputStream.h b/Subtrees/beast/modules/beast_core/streams/beast_InputStream.h
index d90bb5c599..7d7e643234 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_InputStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_InputStream.h
@@ -37,6 +37,8 @@ class MemoryBlock;
@see OutputStream, MemoryInputStream, BufferedInputStream, FileInputStream
*/
class BEAST_API InputStream
+ : public Uncopyable
+ , LeakChecked
{
public:
/** Destructor. */
@@ -285,9 +287,6 @@ public:
protected:
//==============================================================================
InputStream() noexcept {}
-
-private:
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputStream)
};
#endif // BEAST_INPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_MemoryInputStream.h b/Subtrees/beast/modules/beast_core/streams/beast_MemoryInputStream.h
index ce39cc7897..d3e0d0b8d5 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_MemoryInputStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_MemoryInputStream.h
@@ -35,7 +35,9 @@
This can either be used to refer to a shared block of memory, or can make its
own internal copy of the data when the MemoryInputStream is created.
*/
-class BEAST_API MemoryInputStream : public InputStream
+class BEAST_API MemoryInputStream
+ : public InputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -88,8 +90,6 @@ private:
HeapBlock internalCopy;
void createInternalCopy();
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryInputStream)
};
#endif // BEAST_MEMORYINPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_MemoryOutputStream.h b/Subtrees/beast/modules/beast_core/streams/beast_MemoryOutputStream.h
index 98ea3daf90..1413dcbf3d 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_MemoryOutputStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_MemoryOutputStream.h
@@ -36,7 +36,9 @@
The data that was written into the stream can then be accessed later as
a contiguous block of memory.
*/
-class BEAST_API MemoryOutputStream : public OutputStream
+class BEAST_API MemoryOutputStream
+ : public OutputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -120,8 +122,6 @@ private:
void trimExternalBlockSize();
char* prepareToWrite (size_t);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemoryOutputStream)
};
/** Copies all the data that has been written to a MemoryOutputStream into another stream. */
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_OutputStream.h b/Subtrees/beast/modules/beast_core/streams/beast_OutputStream.h
index 052cbc4fc7..9365041ba8 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_OutputStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_OutputStream.h
@@ -41,6 +41,8 @@ class File;
@see InputStream, MemoryOutputStream, FileOutputStream
*/
class BEAST_API OutputStream
+ : public Uncopyable
+ , LeakChecked
{
protected:
//==============================================================================
@@ -220,8 +222,6 @@ public:
private:
//==============================================================================
String newLineString;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OutputStream)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/streams/beast_SubregionStream.h b/Subtrees/beast/modules/beast_core/streams/beast_SubregionStream.h
index f98cdecfe5..cc01fed0a3 100644
--- a/Subtrees/beast/modules/beast_core/streams/beast_SubregionStream.h
+++ b/Subtrees/beast/modules/beast_core/streams/beast_SubregionStream.h
@@ -34,7 +34,9 @@
This lets you take a subsection of a stream and present it as an entire
stream in its own right.
*/
-class BEAST_API SubregionStream : public InputStream
+class BEAST_API SubregionStream
+ : public InputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -80,8 +82,6 @@ public:
private:
OptionalScopedPointer source;
const int64 startPositionInSourceStream, lengthOfSourceStream;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SubregionStream)
};
#endif // BEAST_SUBREGIONSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h b/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h
index 63323de40e..272a916c51 100644
--- a/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h
+++ b/Subtrees/beast/modules/beast_core/system/beast_PlatformDefs.h
@@ -141,41 +141,6 @@ template <> struct BeastStaticAssert { static void dummy() {} };
*/
#define static_bassert(expression) beast::BeastStaticAssert::dummy();
-/** This is a shorthand macro for declaring stubs for a class's copy constructor and operator=.
-
- For example, instead of
- @code
- class MyClass
- {
- etc..
-
- private:
- MyClass (const MyClass&);
- MyClass& operator= (const MyClass&);
- };@endcode
-
- ..you can just write:
-
- @code
- class MyClass
- {
- etc..
-
- private:
- BEAST_DECLARE_NON_COPYABLE (MyClass)
- };@endcode
-*/
-#define BEAST_DECLARE_NON_COPYABLE(className) \
- className (const className&);\
- className& operator= (const className&);
-
-/** This is a shorthand way of writing both a BEAST_DECLARE_NON_COPYABLE and
- BEAST_LEAK_DETECTOR macro for a class.
-*/
-#define BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className) \
- BEAST_DECLARE_NON_COPYABLE(className) \
- BEAST_LEAK_DETECTOR(className)
-
/** This macro can be added to class definitions to disable the use of new/delete to
allocate the object on the heap, forcing it to only be used as a stack or member variable.
*/
diff --git a/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h b/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h
index f2ee59a2ea..15d5bff463 100644
--- a/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h
+++ b/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h
@@ -58,6 +58,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -178,14 +179,7 @@ extern BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger();
extern BEAST_API void BEAST_CALLTYPE logAssertion (char const* file, int line) noexcept;
// These are so common that we include them early
-
-#include "../memory/beast_Uncopyable.h"
-#include "../memory/beast_Memory.h"
-#include "../maths/beast_MathsFunctions.h"
-#include "../memory/beast_ByteOrder.h"
-#include "../logging/beast_Logger.h"
-#include "../memory/beast_LeakedObjectDetector.h"
-
+// ?
}
#endif
diff --git a/Subtrees/beast/modules/beast_core/system/beast_SystemStats.h b/Subtrees/beast/modules/beast_core/system/beast_SystemStats.h
index 16f004ea40..41a6e79562 100644
--- a/Subtrees/beast/modules/beast_core/system/beast_SystemStats.h
+++ b/Subtrees/beast/modules/beast_core/system/beast_SystemStats.h
@@ -30,7 +30,7 @@
/**
Contains methods for finding out about the current hardware and OS configuration.
*/
-class BEAST_API SystemStats
+class BEAST_API SystemStats : Uncopyable
{
public:
//==============================================================================
@@ -194,8 +194,6 @@ private:
SystemStats();
static const CPUFlags& getCPUFlags();
-
- BEAST_DECLARE_NON_COPYABLE (SystemStats)
};
diff --git a/Subtrees/beast/modules/beast_core/text/beast_LocalisedStrings.h b/Subtrees/beast/modules/beast_core/text/beast_LocalisedStrings.h
index 8e805ec007..c8163b318c 100644
--- a/Subtrees/beast/modules/beast_core/text/beast_LocalisedStrings.h
+++ b/Subtrees/beast/modules/beast_core/text/beast_LocalisedStrings.h
@@ -70,7 +70,7 @@
get a list of all the messages by searching for the TRANS() macro in the Beast source
code).
*/
-class BEAST_API LocalisedStrings
+class BEAST_API LocalisedStrings : LeakChecked
{
public:
//==============================================================================
@@ -176,8 +176,6 @@ private:
StringPairArray translations;
void loadFromText (const String&, bool ignoreCase);
-
- BEAST_LEAK_DETECTOR (LocalisedStrings)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/text/beast_StringArray.h b/Subtrees/beast/modules/beast_core/text/beast_StringArray.h
index 26d1536cea..1b0978fe1e 100644
--- a/Subtrees/beast/modules/beast_core/text/beast_StringArray.h
+++ b/Subtrees/beast/modules/beast_core/text/beast_StringArray.h
@@ -34,7 +34,7 @@
@see String, StringPairArray
*/
-class BEAST_API StringArray
+class BEAST_API StringArray : LeakChecked
{
public:
//==============================================================================
@@ -396,10 +396,7 @@ public:
private:
- //==============================================================================
Array strings;
-
- BEAST_LEAK_DETECTOR (StringArray)
};
diff --git a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h
index a3eac9b3bf..3e3fdfc93f 100644
--- a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h
+++ b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h
@@ -33,7 +33,7 @@
@see StringArray
*/
-class BEAST_API StringPairArray
+class BEAST_API StringPairArray : LeakChecked
{
public:
//==============================================================================
@@ -150,8 +150,6 @@ private:
//==============================================================================
StringArray keys, values;
bool ignoreCase;
-
- BEAST_LEAK_DETECTOR (StringPairArray)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ChildProcess.h b/Subtrees/beast/modules/beast_core/threads/beast_ChildProcess.h
index 4875efd608..9efead13b1 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ChildProcess.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ChildProcess.h
@@ -32,7 +32,7 @@
This class lets you launch an executable, and read its output. You can also
use it to check whether the child process has finished.
*/
-class BEAST_API ChildProcess
+class BEAST_API ChildProcess : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -92,8 +92,6 @@ private:
class ActiveProcess;
friend class ScopedPointer;
ScopedPointer activeProcess;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcess)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_CriticalSection.h b/Subtrees/beast/modules/beast_core/threads/beast_CriticalSection.h
index d0da916418..7c8015e8a9 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_CriticalSection.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_CriticalSection.h
@@ -37,7 +37,7 @@
@see ScopedLock, ScopedTryLock, ScopedUnlock, SpinLock, ReadWriteLock, Thread, InterProcessLock
*/
-class BEAST_API CriticalSection
+class BEAST_API CriticalSection : Uncopyable
{
public:
//==============================================================================
@@ -111,8 +111,6 @@ private:
#else
mutable pthread_mutex_t internal;
#endif
-
- BEAST_DECLARE_NON_COPYABLE (CriticalSection)
};
@@ -126,7 +124,7 @@ private:
@see CriticalSection, Array, OwnedArray, ReferenceCountedArray
*/
-class BEAST_API DummyCriticalSection
+class BEAST_API DummyCriticalSection : Uncopyable
{
public:
inline DummyCriticalSection() noexcept {}
@@ -145,9 +143,6 @@ public:
/** A dummy scoped-unlocker type to use with a dummy critical section. */
typedef ScopedLockType ScopedUnlockType;
-
-private:
- BEAST_DECLARE_NON_COPYABLE (DummyCriticalSection)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_DynamicLibrary.h b/Subtrees/beast/modules/beast_core/threads/beast_DynamicLibrary.h
index 9b99c6a8a3..0330163a96 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_DynamicLibrary.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_DynamicLibrary.h
@@ -31,7 +31,7 @@
Since the DLL is freed when this object is deleted, it's handy for managing
library lifetimes using RAII.
*/
-class BEAST_API DynamicLibrary
+class BEAST_API DynamicLibrary : LeakChecked , Uncopyable
{
public:
/** Creates an unopened DynamicLibrary object.
@@ -72,8 +72,6 @@ public:
private:
void* handle;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DynamicLibrary)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_HighResolutionTimer.h b/Subtrees/beast/modules/beast_core/threads/beast_HighResolutionTimer.h
index a42674f911..01f38fdc29 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_HighResolutionTimer.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_HighResolutionTimer.h
@@ -38,7 +38,7 @@
@see Timer
*/
-class BEAST_API HighResolutionTimer
+class BEAST_API HighResolutionTimer : LeakChecked , Uncopyable
{
protected:
/** Creates a HighResolutionTimer.
@@ -96,8 +96,6 @@ private:
friend struct Pimpl;
friend class ScopedPointer;
ScopedPointer pimpl;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HighResolutionTimer)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_InterProcessLock.h b/Subtrees/beast/modules/beast_core/threads/beast_InterProcessLock.h
index 946f29580d..7e4469f8c6 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_InterProcessLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_InterProcessLock.h
@@ -34,7 +34,7 @@
@see CriticalSection
*/
-class BEAST_API InterProcessLock
+class BEAST_API InterProcessLock : Uncopyable
{
public:
//==============================================================================
@@ -71,7 +71,7 @@ public:
@see ScopedLock
*/
- class ScopedLockType
+ class ScopedLockType : Uncopyable
{
public:
//==============================================================================
@@ -106,8 +106,6 @@ public:
//==============================================================================
InterProcessLock& ipLock;
bool lockWasSuccessful;
-
- BEAST_DECLARE_NON_COPYABLE (ScopedLockType)
};
private:
@@ -118,8 +116,6 @@ private:
CriticalSection lock;
String name;
-
- BEAST_DECLARE_NON_COPYABLE (InterProcessLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_Process.h b/Subtrees/beast/modules/beast_core/threads/beast_Process.h
index 2eb5044b26..87b8262d80 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_Process.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_Process.h
@@ -35,7 +35,7 @@
@see Thread, BEASTApplication
*/
-class BEAST_API Process
+class BEAST_API Process : Uncopyable
{
public:
//==============================================================================
@@ -138,7 +138,6 @@ public:
private:
Process();
- BEAST_DECLARE_NON_COPYABLE (Process)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ReadWriteLock.h b/Subtrees/beast/modules/beast_core/threads/beast_ReadWriteLock.h
index 1b9d961e02..880cae41b1 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ReadWriteLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ReadWriteLock.h
@@ -50,7 +50,7 @@
@see ScopedReadLock, ScopedWriteLock, CriticalSection
*/
-class BEAST_API ReadWriteLock
+class BEAST_API ReadWriteLock : Uncopyable
{
public:
//==============================================================================
@@ -146,8 +146,6 @@ private:
};
mutable Array readerThreads;
-
- BEAST_DECLARE_NON_COPYABLE (ReadWriteLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ScopedLock.h b/Subtrees/beast/modules/beast_core/threads/beast_ScopedLock.h
index cd19d5df60..91cc5473de 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ScopedLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ScopedLock.h
@@ -51,7 +51,7 @@
@see GenericScopedUnlock, CriticalSection, SpinLock, ScopedLock, ScopedUnlock
*/
template
-class GenericScopedLock
+class GenericScopedLock : Uncopyable
{
public:
//==============================================================================
@@ -76,8 +76,6 @@ public:
private:
//==============================================================================
const LockType& lock_;
-
- BEAST_DECLARE_NON_COPYABLE (GenericScopedLock)
};
@@ -120,7 +118,7 @@ private:
@see GenericScopedLock, CriticalSection, ScopedLock, ScopedUnlock
*/
template
-class GenericScopedUnlock
+class GenericScopedUnlock : Uncopyable
{
public:
//==============================================================================
@@ -149,8 +147,6 @@ public:
private:
//==============================================================================
const LockType& lock_;
-
- BEAST_DECLARE_NON_COPYABLE (GenericScopedUnlock)
};
@@ -190,7 +186,7 @@ private:
@see CriticalSection::tryEnter, GenericScopedLock, GenericScopedUnlock
*/
template
-class GenericScopedTryLock
+class GenericScopedTryLock : Uncopyable
{
public:
//==============================================================================
@@ -224,8 +220,6 @@ private:
//==============================================================================
const LockType& lock_;
const bool lockWasSuccessful;
-
- BEAST_DECLARE_NON_COPYABLE (GenericScopedTryLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ScopedReadLock.h b/Subtrees/beast/modules/beast_core/threads/beast_ScopedReadLock.h
index 0ec698c6ae..9ec3c1ff55 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ScopedReadLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ScopedReadLock.h
@@ -50,7 +50,7 @@
@see ReadWriteLock, ScopedWriteLock
*/
-class BEAST_API ScopedReadLock
+class BEAST_API ScopedReadLock : Uncopyable
{
public:
//==============================================================================
@@ -79,8 +79,6 @@ public:
private:
//==============================================================================
const ReadWriteLock& lock_;
-
- BEAST_DECLARE_NON_COPYABLE (ScopedReadLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ScopedWriteLock.h b/Subtrees/beast/modules/beast_core/threads/beast_ScopedWriteLock.h
index fc0894fdb1..8bc88ccbdd 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ScopedWriteLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ScopedWriteLock.h
@@ -50,7 +50,7 @@
@see ReadWriteLock, ScopedReadLock
*/
-class BEAST_API ScopedWriteLock
+class BEAST_API ScopedWriteLock : Uncopyable
{
public:
//==============================================================================
@@ -79,8 +79,6 @@ public:
private:
//==============================================================================
const ReadWriteLock& lock_;
-
- BEAST_DECLARE_NON_COPYABLE (ScopedWriteLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.cpp b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.cpp
new file mode 100644
index 0000000000..959dc42f60
--- /dev/null
+++ b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.cpp
@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+SpinDelay::SpinDelay ()
+ : m_count (0)
+{
+}
+
+void SpinDelay::pause ()
+{
+ if (++m_count > 20)
+ Thread::yield ();
+}
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h
index 97cf720061..c51d4ce4ce 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h
@@ -20,22 +20,14 @@
#ifndef BEAST_SPINDELAY_BEASTHEADER
#define BEAST_SPINDELAY_BEASTHEADER
-//
-// Synchronization element
-//
-
+/** A simple delay used to synchronize threads.
+*/
class BEAST_API SpinDelay
{
public:
- SpinDelay () : m_count (0)
- {
- }
+ SpinDelay ();
- inline void pause ()
- {
- if (++m_count > 20)
- Thread::yield ();
- }
+ void pause ();
private:
int m_count;
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_SpinLock.h b/Subtrees/beast/modules/beast_core/threads/beast_SpinLock.h
index 4d773a6042..f8eec63a7b 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_SpinLock.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_SpinLock.h
@@ -40,7 +40,7 @@
@see CriticalSection
*/
-class BEAST_API SpinLock
+class BEAST_API SpinLock : Uncopyable
{
public:
inline SpinLock() noexcept {}
@@ -80,8 +80,6 @@ public:
private:
//==============================================================================
mutable Atomic lock;
-
- BEAST_DECLARE_NON_COPYABLE (SpinLock)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_Thread.cpp b/Subtrees/beast/modules/beast_core/threads/beast_Thread.cpp
index b891733651..dfebf33aaa 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_Thread.cpp
+++ b/Subtrees/beast/modules/beast_core/threads/beast_Thread.cpp
@@ -48,14 +48,12 @@ Thread::~Thread()
//==============================================================================
// Use a ref-counted object to hold this shared data, so that it can outlive its static
// shared pointer when threads are still running during static shutdown.
-struct CurrentThreadHolder : public ReferenceCountedObject
+struct CurrentThreadHolder : public ReferenceCountedObject
{
CurrentThreadHolder() noexcept {}
typedef ReferenceCountedObjectPtr Ptr;
ThreadLocalValue value;
-
- BEAST_DECLARE_NON_COPYABLE (CurrentThreadHolder)
};
static char currentThreadHolderLock [sizeof (SpinLock)]; // (statically initialised to zeros).
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_Thread.h b/Subtrees/beast/modules/beast_core/threads/beast_Thread.h
index e553913da6..e0d28b64ae 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_Thread.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_Thread.h
@@ -42,7 +42,7 @@
@see CriticalSection, WaitableEvent, Process, ThreadWithProgressWindow,
MessageManagerLock
*/
-class BEAST_API Thread
+class BEAST_API Thread : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -280,8 +280,6 @@ private:
void killThread();
void threadEntryPoint();
static bool setThreadPriority (void*, int);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Thread)
};
#endif // BEAST_THREAD_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ThreadLocalValue.h b/Subtrees/beast/modules/beast_core/threads/beast_ThreadLocalValue.h
index 2a0bd68fe4..e3aede01fb 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ThreadLocalValue.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ThreadLocalValue.h
@@ -51,7 +51,7 @@
is deleted.
*/
template
-class ThreadLocalValue
+class ThreadLocalValue : Uncopyable
{
public:
/** */
@@ -170,7 +170,7 @@ public:
private:
//==============================================================================
#if BEAST_NO_COMPILER_THREAD_LOCAL
- struct ObjectHolder
+ struct ObjectHolder : Uncopyable
{
ObjectHolder (const Thread::ThreadID& tid)
: threadId (tid), object()
@@ -179,15 +179,11 @@ private:
Thread::ThreadID threadId;
ObjectHolder* next;
Type object;
-
- BEAST_DECLARE_NON_COPYABLE (ObjectHolder)
};
mutable Atomic first;
SpinLock lock;
#endif
-
- BEAST_DECLARE_NON_COPYABLE (ThreadLocalValue)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.cpp b/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.cpp
index c59e1550b3..951383066c 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.cpp
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.cpp
@@ -53,7 +53,9 @@ void ThreadPoolJob::signalJobShouldExit()
}
//==============================================================================
-class ThreadPool::ThreadPoolThread : public Thread
+class ThreadPool::ThreadPoolThread
+ : public Thread
+ , LeakChecked
{
public:
ThreadPoolThread (ThreadPool& pool_)
@@ -73,8 +75,6 @@ public:
private:
ThreadPool& pool;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolThread)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.h b/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.h
index d4d5dfe835..81bc7a73b5 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_ThreadPool.h
@@ -46,7 +46,7 @@ class ThreadPoolThread;
@see ThreadPool, Thread
*/
-class BEAST_API ThreadPoolJob
+class BEAST_API ThreadPoolJob : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -125,8 +125,6 @@ private:
String jobName;
ThreadPool* pool;
bool shouldStop, isActive, shouldBeDeleted;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolJob)
};
@@ -139,7 +137,7 @@ private:
@see ThreadPoolJob, Thread
*/
-class BEAST_API ThreadPool
+class BEAST_API ThreadPool : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -305,8 +303,6 @@ private:
// Note that this method has changed, and no longer has a parameter to indicate
// whether the jobs should be deleted - see the new method for details.
void removeAllJobs (bool, int, bool);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPool)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_TimeSliceThread.h b/Subtrees/beast/modules/beast_core/threads/beast_TimeSliceThread.h
index fb783d233a..ca0b7cc25a 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_TimeSliceThread.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_TimeSliceThread.h
@@ -79,7 +79,9 @@ private:
@see TimeSliceClient, Thread
*/
-class BEAST_API TimeSliceThread : public Thread
+class BEAST_API TimeSliceThread
+ : public Thread
+ , LeakChecked
{
public:
//==============================================================================
@@ -139,8 +141,6 @@ private:
TimeSliceClient* clientBeingCalled;
TimeSliceClient* getNextClient (int index) const;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TimeSliceThread)
};
diff --git a/Subtrees/beast/modules/beast_core/threads/beast_WaitableEvent.h b/Subtrees/beast/modules/beast_core/threads/beast_WaitableEvent.h
index e95ef02044..8d8558d910 100644
--- a/Subtrees/beast/modules/beast_core/threads/beast_WaitableEvent.h
+++ b/Subtrees/beast/modules/beast_core/threads/beast_WaitableEvent.h
@@ -35,7 +35,7 @@
calling thread until another thread wakes it up by calling the signal()
method.
*/
-class BEAST_API WaitableEvent
+class BEAST_API WaitableEvent : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -106,8 +106,6 @@ private:
mutable pthread_mutex_t mutex;
mutable bool triggered, manualReset;
#endif
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WaitableEvent)
};
diff --git a/Subtrees/beast/modules/beast_core/unit_tests/beast_UnitTest.h b/Subtrees/beast/modules/beast_core/unit_tests/beast_UnitTest.h
index d155f0d7b5..96eb2c89b0 100644
--- a/Subtrees/beast/modules/beast_core/unit_tests/beast_UnitTest.h
+++ b/Subtrees/beast/modules/beast_core/unit_tests/beast_UnitTest.h
@@ -67,7 +67,7 @@ class UnitTestRunner;
@see UnitTestRunner
*/
-class BEAST_API UnitTest
+class BEAST_API UnitTest : Uncopyable
{
public:
//==============================================================================
@@ -164,8 +164,6 @@ private:
//==============================================================================
const String name;
UnitTestRunner* runner;
-
- BEAST_DECLARE_NON_COPYABLE (UnitTest)
};
@@ -181,7 +179,7 @@ private:
@see UnitTest
*/
-class BEAST_API UnitTestRunner
+class BEAST_API UnitTestRunner : Uncopyable
{
public:
//==============================================================================
@@ -277,8 +275,6 @@ private:
void addPass();
void addFail (const String& failureMessage);
-
- BEAST_DECLARE_NON_COPYABLE (UnitTestRunner)
};
diff --git a/Subtrees/beast/modules/beast_core/xml/beast_XmlDocument.h b/Subtrees/beast/modules/beast_core/xml/beast_XmlDocument.h
index 443902225e..3e51feecad 100644
--- a/Subtrees/beast/modules/beast_core/xml/beast_XmlDocument.h
+++ b/Subtrees/beast/modules/beast_core/xml/beast_XmlDocument.h
@@ -67,7 +67,7 @@ class InputSource;
@see XmlElement
*/
-class BEAST_API XmlDocument
+class BEAST_API XmlDocument : LeakChecked , Uncopyable
{
public:
//==============================================================================
@@ -173,8 +173,6 @@ private:
String expandEntity (const String& entity);
String expandExternalEntity (const String& entity);
String getParameterEntity (const String& entity);
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (XmlDocument)
};
diff --git a/Subtrees/beast/modules/beast_core/xml/beast_XmlElement.h b/Subtrees/beast/modules/beast_core/xml/beast_XmlElement.h
index 9705b78ea8..042c2274f6 100644
--- a/Subtrees/beast/modules/beast_core/xml/beast_XmlElement.h
+++ b/Subtrees/beast/modules/beast_core/xml/beast_XmlElement.h
@@ -139,7 +139,7 @@
@see XmlDocument
*/
-class BEAST_API XmlElement
+class BEAST_API XmlElement : LeakChecked
{
public:
//==============================================================================
@@ -726,8 +726,6 @@ private:
void writeElementAsText (OutputStream&, int indentationLevel, int lineWrapLength) const;
void getChildElementsAsArray (XmlElement**) const noexcept;
void reorderChildElements (XmlElement**, int) noexcept;
-
- BEAST_LEAK_DETECTOR (XmlElement)
};
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.cpp b/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.cpp
index a2467d15f8..725aba87f1 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.cpp
+++ b/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.cpp
@@ -26,7 +26,7 @@
==============================================================================
*/
-class GZIPCompressorOutputStream::GZIPCompressorHelper
+class GZIPCompressorOutputStream::GZIPCompressorHelper : Uncopyable
{
public:
GZIPCompressorHelper (const int compressionLevel, const int windowBits)
@@ -114,8 +114,6 @@ private:
return false;
}
-
- BEAST_DECLARE_NON_COPYABLE (GZIPCompressorHelper)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.h b/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.h
index 6d7a66d6f5..c083afc45f 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.h
+++ b/Subtrees/beast/modules/beast_core/zip/beast_GZIPCompressorOutputStream.h
@@ -44,7 +44,9 @@
@see GZIPDecompressorInputStream
*/
-class BEAST_API GZIPCompressorOutputStream : public OutputStream
+class BEAST_API GZIPCompressorOutputStream
+ : public OutputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -98,8 +100,6 @@ private:
class GZIPCompressorHelper;
friend class ScopedPointer ;
ScopedPointer helper;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPCompressorOutputStream)
};
#endif // BEAST_GZIPCOMPRESSOROUTPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.cpp b/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.cpp
index ad1c8d4dd0..5f69fa68aa 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.cpp
+++ b/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.cpp
@@ -82,7 +82,7 @@ namespace zlibNamespace
//==============================================================================
// internal helper object that holds the zlib structures so they don't have to be
// included publicly.
-class GZIPDecompressorInputStream::GZIPDecompressHelper
+class GZIPDecompressorInputStream::GZIPDecompressHelper : Uncopyable
{
public:
GZIPDecompressHelper (const bool dontWrap)
@@ -160,8 +160,6 @@ private:
zlibNamespace::z_stream stream;
uint8* data;
size_t dataSize;
-
- BEAST_DECLARE_NON_COPYABLE (GZIPDecompressHelper)
};
//==============================================================================
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.h b/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.h
index 8dfc79cff7..e77444a0ae 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.h
+++ b/Subtrees/beast/modules/beast_core/zip/beast_GZIPDecompressorInputStream.h
@@ -44,7 +44,9 @@
@see GZIPCompressorOutputStream
*/
-class BEAST_API GZIPDecompressorInputStream : public InputStream
+class BEAST_API GZIPDecompressorInputStream
+ : public InputStream
+ , LeakChecked
{
public:
//==============================================================================
@@ -95,8 +97,6 @@ private:
class GZIPDecompressHelper;
friend class ScopedPointer ;
ScopedPointer helper;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPDecompressorInputStream)
};
#endif // BEAST_GZIPDECOMPRESSORINPUTSTREAM_BEASTHEADER
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.cpp b/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.cpp
index 66bdf071ed..7ace22e120 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.cpp
+++ b/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.cpp
@@ -111,7 +111,9 @@ namespace
}
//==============================================================================
-class ZipFile::ZipInputStream : public InputStream
+class ZipFile::ZipInputStream
+ : public InputStream
+ , LeakChecked
{
public:
ZipInputStream (ZipFile& zf, ZipFile::ZipEntryHolder& zei)
@@ -208,8 +210,6 @@ private:
int headerSize;
InputStream* inputStream;
ScopedPointer streamToDelete;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZipInputStream)
};
@@ -442,7 +442,7 @@ Result ZipFile::uncompressEntry (const int index,
//=============================================================================
extern unsigned long beast_crc32 (unsigned long crc, const unsigned char*, unsigned len);
-class ZipFile::Builder::Item
+class ZipFile::Builder::Item : LeakChecked , Uncopyable
{
public:
Item (const File& f, const int compression, const String& storedPath)
@@ -547,8 +547,6 @@ private:
target.writeShort ((short) storedPathname.toUTF8().sizeInBytes() - 1);
target.writeShort (0); // extra field length
}
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Item)
};
//=============================================================================
diff --git a/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.h b/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.h
index eabedab4c9..d137d3fefc 100644
--- a/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.h
+++ b/Subtrees/beast/modules/beast_core/zip/beast_ZipFile.h
@@ -42,7 +42,7 @@
This can enumerate the items in a ZIP file and can create suitable stream objects
to read each one.
*/
-class BEAST_API ZipFile
+class BEAST_API ZipFile : LeakChecked , Uncopyable
{
public:
/** Creates a ZipFile based for a file. */
@@ -184,7 +184,7 @@ public:
Currently this just stores the files with no compression.. That will be added
soon!
*/
- class Builder
+ class Builder : LeakChecked , Uncopyable
{
public:
Builder();
@@ -212,8 +212,6 @@ public:
class Item;
friend class OwnedArray- ;
OwnedArray
- items;
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Builder)
};
private:
@@ -242,8 +240,6 @@ private:
#endif
void init();
-
- BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZipFile)
};
#endif // BEAST_ZIPFILE_BEASTHEADER
diff --git a/TODO.txt b/TODO.txt
index 42531891c6..fea5d70589 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -2,6 +2,9 @@
BEAST TODO
--------------------------------------------------------------------------------
+- Remove anything having to do with DLL builds like
+ BEAST_DLL, BEAST_DLL_BUILD, BEAST_DISABLE_DLL_ALLOCATORS
+
- Fix FifoFreeStoreWithTLS reference counting bug
- Implement a reasonable substitute for boost's thread_local_storage
diff --git a/src/cpp/ripple/ripple_Main.cpp b/src/cpp/ripple/ripple_Main.cpp
index f94d5b3658..d8612bef04 100644
--- a/src/cpp/ripple/ripple_Main.cpp
+++ b/src/cpp/ripple/ripple_Main.cpp
@@ -135,6 +135,7 @@ int rippleMain (int argc, char** argv)
#if 0
// This is some temporary leak checking test code
ThreadWithCallQueue t ("test");
+GlobalPagedFreeStore::getInstance ();
t.start ();
return 0;
#endif