class EE::MemoryManager

Overview

#include <memorymanager.hpp>

class MemoryManager {
public:
    // methods

    static void* addPointer(const AllocatedPointer& aAllocatedPointer);
    static void* reallocPointer(void* data, const AllocatedPointer& aAllocatedPointer);
    static void* addPointerInPlace(void* place, const AllocatedPointer& aAllocatedPointer);
    static bool removePointer(void* data, const char* file, const size_t& line);
    static bool removePointerIfTracked(void* data);
    static void showResults();

    template <class T>
    static T* deletePtr(T* data, const char* file, size_t line);

    template <class T>
    static T* deleteArrayPtr(T* data, const char* file, size_t line);

    template <class T>
    static T* free(T* data);

    static void* allocate(size_t size);
    static void* reallocate(void* ptr, size_t size);
    static void* allocateGlobal(size_t size, size_t alignment);
    static void freeGlobal(void* ptr);

    template <typename T>
    static T* trackNew(T* pointer, const char* file, int line);

    static size_t getPeakMemoryUsage();
    static size_t getTotalMemoryUsage();
    static AllocatedPointer getBiggestAllocation();
    static AllocatedPointer getBiggestNonAnonymousAllocation();
};

Detailed Documentation

Methods

static bool removePointerIfTracked(void* data)

Removes a pointer when it is tracked, without diagnosing foreign allocator bookkeeping.

static void* allocateGlobal(size_t size, size_t alignment)

Allocation entry points used by the debug global new/delete overrides.