docs: update memory and threading API docs

This commit is contained in:
2026-03-20 02:35:24 +08:00
parent c5b17239ca
commit fd792b7df1
103 changed files with 2485 additions and 673 deletions

View File

@@ -0,0 +1,33 @@
# PoolAllocator::GetPeakAllocated
```cpp
size_t GetPeakAllocated() const override;
```
返回峰值分配的内存总量(字节)。由于池在构造时预分配所有块,峰值即为 `m_totalBlocks * m_blockSize`
**参数:**
**返回:** 内存池总容量(字节)
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Memory/PoolAllocator.h>
PoolAllocator pool(sizeof(int), 100);
size_t peak = pool.GetPeakAllocated(); // 100 * sizeof(int)
// 即使分配了部分块,峰值仍然是总容量
void* block1 = pool.Allocate();
void* block2 = pool.Allocate();
size_t current = pool.GetTotalAllocated(); // 2 * sizeof(int)
peak = pool.GetPeakAllocated(); // 100 * sizeof(int)
```
## 相关文档
- [PoolAllocator 总览](pool-allocator.md) - 返回类总览