docs: update memory and threading API docs
This commit is contained in:
31
docs/api/memory/memorymanager/dumpmemoryleaks.md
Normal file
31
docs/api/memory/memorymanager/dumpmemoryleaks.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# MemoryManager::DumpMemoryLeaks
|
||||
|
||||
```cpp
|
||||
void DumpMemoryLeaks();
|
||||
```
|
||||
|
||||
输出当前未释放的内存分配信息。如果启用了内存跟踪,此方法会遍历所有记录并报告疑似泄漏的分配。应在程序退出前调用,以便发现资源泄漏。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/MemoryManager.h>
|
||||
|
||||
MemoryManager::Get().Initialize();
|
||||
|
||||
// ... 程序运行 ...
|
||||
|
||||
// 程序退出前检查泄漏
|
||||
MemoryManager::Get().DumpMemoryLeaks();
|
||||
MemoryManager::Get().Shutdown();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [MemoryManager 总览](memorymanager.md) - 返回类总览
|
||||
Reference in New Issue
Block a user