Files
NazaraEngine/include/Nazara/Core/MemoryManager.hpp
Jérôme Leclercq 03e2801dbe Split engine to packages NazaraUtils and NZSL (#375)
* Move code to NazaraUtils and NZSL packages

* Reorder includes

* Tests: Remove glslang and spirv-tools deps

* Tests: Remove glslang init

* Remove NazaraUtils tests and fix Vector4Test

* Fix Linux compilation

* Update msys2-build.yml

* Fix assimp package

* Update xmake.lua

* Update xmake.lua

* Fix shader compilation on MinGW

* Final fixes

* The final fix 2: the fix strikes back!

* Disable cache on CI

* The return of the fix™️
2022-05-25 19:36:10 +02:00

46 lines
1.2 KiB
C++

// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CORE_MEMORYMANAGER_HPP
#define NAZARA_CORE_MEMORYMANAGER_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <cstddef>
namespace Nz
{
class NAZARA_CORE_API MemoryManager
{
public:
static void* Allocate(std::size_t size, bool multi = false, const char* file = nullptr, unsigned int line = 0);
static void EnableAllocationFilling(bool allocationFilling);
static void EnableAllocationLogging(bool logAllocations);
static void Free(void* pointer, bool multi = false);
static unsigned int GetAllocatedBlockCount();
static std::size_t GetAllocatedSize();
static unsigned int GetAllocationCount();
static bool IsAllocationFillingEnabled();
static bool IsAllocationLoggingEnabled();
static void NextFree(const char* file, unsigned int line);
private:
MemoryManager();
~MemoryManager();
static void Initialize();
static void TimeInfo(char buffer[23]);
static void Uninitialize();
};
}
#endif // NAZARA_CORE_MEMORYMANAGER_HPP