#include "Platform.h"
#include "Threading.h"
Namespaces | |
namespace | Common |
Classes | |
class | Common::GaSmartStorage< T > |
GaSmartStorage template class provides reference-counting for smart pointers. GaSmartStorage objects holds address of used data and number of references (smart pointers) which point to the data. Object of this class as well as the data are destroyed and memory is freed when there are no more references which points to the data. Arrays cannot be used with this class. This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class, but all public method and operators are thread-safe. More... | |
class | Common::GaSmartPtr< T > |
GaSmartPtr template class wraps C++ raw pointers, and takes over responsibility of managing the allocated memory. Smart pointer holds address of user data and reference to an object which is responsible for counting number of references to data, when there are no instances of GaSmartPtr pointing to location of the data (reference count of the location reaches 0), object is destroyed and memory used by the object is freed. Memory management by GaSmartPtr class is thread-safe, but after dereferencing smart pointer to access the data, it cannot be guaranteed that memory will not be freed if some other thread changes dereferenced pointer. Implemented smart pointers have some limitations: 1. Dynamically allocated arrays cannot be managed by GaSmartPtr class. 2. Circular references can cause memory leakage. More... |