Add missing destructor documentation for PoolAllocator and ProxyAllocator

- 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)
This commit is contained in:
2026-03-19 01:15:45 +08:00
parent 94beec946b
commit 8c719418d0
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# ProxyAllocator::~ProxyAllocator
```cpp
~ProxyAllocator() override;
```
销毁代理分配器。此析构函数不释放底层分配器,只清理代理分配器自身的统计信息(互斥锁等)。底层分配器由创建者负责管理。
**参数:**
**返回:**
**注意:** 析构函数不释放底层分配器。如果需要释放底层分配器,应先调用 `Shutdown` 或显式销毁底层分配器。
**示例:**
```cpp
#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 总览](proxy-allocator.md) - 返回类总览