/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Memory/Policies/AllocPolicyGuarding.h
25 строк
596 B
Jan Krassnigg
Renamed files and classes related to allocators (#1176)
22 янв 2024, 23:46
Не верифицирован
22 янв 2024, 23:46
9ab9b69
Код
Авторство
О чём код?
#pragma once #include <Foundation/Containers/StaticRingBuffer.h> #include <Foundation/Math/Math.h> #include <Foundation/Threading/Lock.h> #include <Foundation/Threading/Mutex.h> class ezAllocPolicyGuarding { public: ezAllocPolicyGuarding(ezAllocator* pParent); EZ_ALWAYS_INLINE ~ezAllocPolicyGuarding() = default; void* Allocate(size_t uiSize, size_t uiAlign); void Deallocate(void* pPtr); EZ_ALWAYS_INLINE ezAllocator* GetParent() const { return nullptr; } private: ezMutex m_Mutex; ezUInt32 m_uiPageSize; ezStaticRingBuffer<void*, (1 << 16)> m_AllocationsToFreeLater; };