docs: update memory and threading API docs
This commit is contained in:
29
docs/api/memory/pool-allocator/get-name.md
Normal file
29
docs/api/memory/pool-allocator/get-name.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# PoolAllocator::GetName
|
||||
|
||||
```cpp
|
||||
const char* GetName() const override;
|
||||
```
|
||||
|
||||
返回分配器的名称字符串 "PoolAllocator"。用于调试和日志记录。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 固定返回 `"PoolAllocator"` 字符串
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/PoolAllocator.h>
|
||||
#include <iostream>
|
||||
|
||||
PoolAllocator pool(sizeof(int), 100);
|
||||
|
||||
const char* name = pool.GetName(); // "PoolAllocator"
|
||||
std::cout << "Allocator: " << name << std::endl;
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [PoolAllocator 总览](pool-allocator.md) - 返回类总览
|
||||
Reference in New Issue
Block a user