Files
XCSDD/docs/api/memory/manager/get-system-allocator.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

28 lines
636 B
Markdown

# MemoryManager::GetSystemAllocator
```cpp
IAllocator* GetSystemAllocator();
```
获取系统默认分配器。该分配器使用标准 C 库的 `std::malloc` 和平台特定的对齐分配函数(如 Windows 的 `_aligned_malloc`)作为后端,适用于通用内存分配场景。
**参数:**
**返回:** 系统分配器指针
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Memory/MemoryManager.h>
IAllocator* sysAlloc = MemoryManager::Get().GetSystemAllocator();
void* ptr = sysAlloc->Allocate(1024);
sysAlloc->Free(ptr);
```
## 相关文档
- [MemoryManager 总览](manager.md) - 返回类总览