Files
XCEngine/docs/api/XCEngine/Memory/MemoryManager/GetSystemAllocator.md

27 lines
623 B
Markdown
Raw Normal View History

2026-03-26 16:45:24 +08:00
# MemoryManager::GetSystemAllocator
2026-03-26 18:02:29 +08:00
获取内部系统分配器。
2026-03-26 16:45:24 +08:00
```cpp
IAllocator* GetSystemAllocator();
```
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_systemAllocator`,不会增加引用计数,也不会转移所有权。
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
- `IAllocator*` - 系统分配器指针;未初始化或已关闭时为 `nullptr`
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
- 这是一个非拥有指针。
- 只有在 [Initialize](Initialize.md) 之后、[Shutdown](Shutdown.md) 之前使用才安全。
2026-03-26 16:45:24 +08:00
## 相关文档
2026-03-26 18:02:29 +08:00
- [返回类型总览](MemoryManager.md)
- [Initialize](Initialize.md)
- [Shutdown](Shutdown.md)