- Created docs/api/memory/pool-allocator/~pool-allocator.md documenting the destructor - Created docs/api/memory/proxy-allocator/~proxy-allocator.md documenting the destructor - Added ~ProxyAllocator entry to proxy-allocator.md overview table - Verified link validation passes (no broken references)
978 B
978 B
ProxyAllocator::~ProxyAllocator
~ProxyAllocator() override;
销毁代理分配器。此析构函数不释放底层分配器,只清理代理分配器自身的统计信息(互斥锁等)。底层分配器由创建者负责管理。
参数: 无
返回: 无
注意: 析构函数不释放底层分配器。如果需要释放底层分配器,应先调用 Shutdown 或显式销毁底层分配器。
示例:
#include <XCEngine/Memory/MemoryManager.h>
#include <XCEngine/Memory/ProxyAllocator.h>
{
MemoryManager::Get().Initialize();
IAllocator* sysAlloc = MemoryManager::Get().GetSystemAllocator();
auto proxy = MemoryManager::Get().CreateProxyAllocator("TrackedAlloc");
proxy->Allocate(1024);
// proxy 超出作用域时自动销毁
// 底层 sysAlloc 仍有效
MemoryManager::Get().Shutdown();
}
相关文档
- ProxyAllocator 总览 - 返回类总览