docs: update memory and threading API docs
This commit is contained in:
35
docs/api/memory/memorymanager/settrackallocations.md
Normal file
35
docs/api/memory/memorymanager/settrackallocations.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# MemoryManager::SetTrackAllocations
|
||||
|
||||
```cpp
|
||||
void SetTrackAllocations(bool track);
|
||||
```
|
||||
|
||||
设置是否启用内存分配跟踪。启用后系统会记录所有分配操作,用于生成内存报告和泄漏检测。
|
||||
|
||||
**参数:**
|
||||
- `track` - true 启用跟踪,false 禁用跟踪
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/MemoryManager.h>
|
||||
|
||||
MemoryManager::Get().Initialize();
|
||||
|
||||
// 禁用跟踪(提升性能)
|
||||
MemoryManager::Get().SetTrackAllocations(false);
|
||||
|
||||
// ... 大量内存操作 ...
|
||||
|
||||
// 重新启用跟踪进行分析
|
||||
MemoryManager::Get().SetTrackAllocations(true);
|
||||
MemoryManager::Get().GenerateMemoryReport();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [MemoryManager 总览](memorymanager.md) - 返回类总览
|
||||
Reference in New Issue
Block a user