2026-03-26 16:45:24 +08:00
|
|
|
# LinearAllocator::GetCapacity
|
|
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
查询线性分配器的总容量。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
size_t GetCapacity() const;
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
## 行为说明
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
返回构造时保存的 `m_capacity`,不受当前已用偏移量影响。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
## 返回值
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
- `size_t` - 总容量。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
2026-03-26 18:02:29 +08:00
|
|
|
- [返回类型总览](LinearAllocator.md)
|
|
|
|
|
- [GetUsedSize](GetUsedSize.md)
|