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
This commit is contained in:
2026-03-19 12:44:08 +08:00
parent e003fe6513
commit 58a83f445a
1012 changed files with 56880 additions and 22 deletions

View File

@@ -0,0 +1,50 @@
# IAllocator::GetTotalFreed
```cpp
virtual size_t GetTotalFreed() const = 0;
```
返回此分配器自创建以来累计释放的字节总数。部分分配器(如 LinearAllocator可能始终返回 0因为它们不跟踪单个释放操作。
**参数:**
**返回:** 累计已释放的字节数
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Memory/Allocator.h>
class MyAllocator : public IAllocator {
size_t m_freed = 0;
public:
void* Allocate(size_t size, size_t alignment = 0) override { return ::operator new(size); }
void Free(void* ptr) override {
if (ptr) {
size_t size = 256; // 需要外部记录
::operator delete(ptr);
m_freed += size;
}
}
void* Reallocate(void* ptr, size_t newSize) override { /* ... */ }
size_t GetTotalAllocated() const override { return 0; }
size_t GetTotalFreed() const override { return m_freed; }
size_t GetPeakAllocated() const override { return 0; }
size_t GetAllocationCount() const override { return 0; }
const char* GetName() const override { return "MyAllocator"; }
};
MyAllocator alloc;
void* ptr = alloc.Allocate(128);
alloc.Free(ptr);
size_t freed = alloc.GetTotalFreed(); // 返回 128
```
## 相关文档
- [IAllocator 总览](allocator.md) - 返回类总览