docs: rebuild Memory API content

This commit is contained in:
2026-03-26 18:02:29 +08:00
parent ce2eee32e3
commit dc252502ac
66 changed files with 1182 additions and 1066 deletions

View File

@@ -1,30 +1,23 @@
# IAllocator::GetTotalAllocated
获取相关状态或对象
查询累计或当前已分配量
```cpp
virtual size_t GetTotalAllocated() const = 0;
```
该方法声明于 `XCEngine/Memory/Allocator.h`,当前页面用于固定 `IAllocator` 类目录下的方法级 canonical 路径。
## 行为说明
**参数:** 无。
这是纯虚统计接口。当前不同实现的语义不同:
**返回:** `size_t` - 返回值语义详见头文件声明
- `LinearAllocator` 返回当前已用大小
- `PoolAllocator` 返回当前已占用 block 总字节数。
- `ProxyAllocator` 返回累计请求分配字节数。
**示例:**
## 返回值
```cpp
#include <XCEngine/Memory/Allocator.h>
void Example() {
XCEngine::Memory::IAllocator object;
// 根据上下文补齐参数后调用 IAllocator::GetTotalAllocated(...)。
(void)object;
}
```
- `size_t` - 实现定义的分配量。
## 相关文档
- [返回类总览](Allocator.md)
- [返回模块目录](../Memory.md)
- [返回类总览](Allocator.md)