/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Memory/Policies/AllocPolicyProxy.h
35 строк
1 KB
Jan Krassnigg
Fixes for including public ez headers (#1755)
04 янв 2026, 10:57
Не верифицирован
04 янв 2026, 10:57
5feb7ef
Код
Авторство
О чём код?
#pragma once #include <Foundation/Basics.h> #include <Foundation/Memory/Allocator.h> /// \brief This Allocation policy redirects all operations to its parent. /// /// \note Note that the stats are taken on the proxy as well as on the parent. /// /// \see ezAllocatorWithPolicy class ezAllocPolicyProxy { public: EZ_FORCE_INLINE ezAllocPolicyProxy(ezAllocator* pParent) : m_pParent(pParent) { EZ_ASSERT_ALWAYS(m_pParent != nullptr, "Parent allocator must not be nullptr"); } EZ_FORCE_INLINE void* Allocate(size_t uiSize, size_t uiAlign) { return m_pParent->Allocate(uiSize, uiAlign); } EZ_FORCE_INLINE void* Reallocate(void* pPtr, size_t uiCurrentSize, size_t uiNewSize, size_t uiAlign) { return m_pParent->Reallocate(pPtr, uiCurrentSize, uiNewSize, uiAlign); } EZ_FORCE_INLINE void Deallocate(void* pPtr) { m_pParent->Deallocate(pPtr); } EZ_FORCE_INLINE size_t AllocatedSize(const void* pPtr) { return m_pParent->AllocatedSize(pPtr); } EZ_ALWAYS_INLINE ezAllocator* GetParent() const { return m_pParent; } private: ezAllocator* m_pParent; };