docs: update memory and threading API docs
This commit is contained in:
32
docs/api/memory/proxy-allocator/get-name.md
Normal file
32
docs/api/memory/proxy-allocator/get-name.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# ProxyAllocator::GetName
|
||||
|
||||
```cpp
|
||||
const char* GetName() const override;
|
||||
```
|
||||
|
||||
获取分配器的名称字符串。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 分配器名称字符串
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/MemoryManager.h>
|
||||
#include <XCEngine/Memory/ProxyAllocator.h>
|
||||
|
||||
IAllocator* sysAlloc = MemoryManager::Get().GetSystemAllocator();
|
||||
ProxyAllocator proxy(sysAlloc, "TrackedAlloc");
|
||||
|
||||
const char* name = proxy.GetName();
|
||||
printf("Allocator name: %s\n", name);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ProxyAllocator 总览](proxy-allocator.md) - 返回类总览
|
||||
Reference in New Issue
Block a user