|
|
@@ -26,10 +26,8 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
-#include "Types.h"
|
|
|
-#include "Memory.h"
|
|
|
#include "Allocator.h"
|
|
|
-#include "ScopedMutex.h"
|
|
|
+#include "Macros.h"
|
|
|
|
|
|
namespace crown
|
|
|
{
|
|
|
@@ -44,44 +42,44 @@ class CE_EXPORT ProxyAllocator : public Allocator
|
|
|
public:
|
|
|
|
|
|
/// Tag all allocations made with @a allocator by the given @a name
|
|
|
- ProxyAllocator(const char* name, Allocator& allocator);
|
|
|
+ ProxyAllocator(const char* name, Allocator& allocator);
|
|
|
|
|
|
/// @copydoc Allocator::allocate()
|
|
|
- void* allocate(size_t size, size_t align = memory::DEFAULT_ALIGN);
|
|
|
+ void* allocate(size_t size, size_t align = Allocator::DEFAULT_ALIGN);
|
|
|
|
|
|
/// @copydoc Allocator::deallocate()
|
|
|
- void deallocate(void* data);
|
|
|
+ void deallocate(void* data);
|
|
|
|
|
|
/// @copydoc Allocator::allocated_size()
|
|
|
- size_t allocated_size();
|
|
|
+ size_t allocated_size();
|
|
|
|
|
|
/// Returns the name of the proxy allocator
|
|
|
- const char* name() const;
|
|
|
+ const char* name() const;
|
|
|
|
|
|
public:
|
|
|
|
|
|
/// Returns the total number of proxy allocators.
|
|
|
/// in the global list.
|
|
|
- static uint32_t count();
|
|
|
+ static uint32_t count();
|
|
|
|
|
|
/// Returns the proxy allocator @name or NULL if not found.
|
|
|
- static ProxyAllocator* find(const char* name);
|
|
|
+ static ProxyAllocator* find(const char* name);
|
|
|
|
|
|
/// Returns the first proxy allocator in the global list or
|
|
|
/// NULL if the list is empty.
|
|
|
- static ProxyAllocator* begin();
|
|
|
+ static ProxyAllocator* begin();
|
|
|
|
|
|
/// Returns the next proxy allocator to @a a in the global list
|
|
|
/// or NULL if end-of-list is reached.
|
|
|
- static ProxyAllocator* next(ProxyAllocator* a);
|
|
|
+ static ProxyAllocator* next(ProxyAllocator* a);
|
|
|
|
|
|
private:
|
|
|
|
|
|
- Allocator& m_allocator;
|
|
|
- const char* m_name;
|
|
|
- size_t m_total_allocated;
|
|
|
+ Allocator& m_allocator;
|
|
|
+ const char* m_name;
|
|
|
+ size_t m_total_allocated;
|
|
|
|
|
|
- ProxyAllocator* m_next;
|
|
|
+ ProxyAllocator* m_next;
|
|
|
};
|
|
|
|
|
|
} // namespace crown
|