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,43 @@
# LinearAllocator::GetMarker
```cpp
void* GetMarker() const;
```
获取当前分配位置的标记。标记是内部偏移量(`m_offset`)的快照,可用于 `SetMarker` 恢复到该位置。此方法用于实现临时分配的撤销功能。
**参数:**
**返回:** 当前位置标记(偏移量值),类型为 `void*`
**注意:** 返回值是偏移量数值,不是指针。将其传给 `SetMarker` 可恢复到此分配位置。
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Memory/LinearAllocator.h>
LinearAllocator allocator(1024);
// 分配一些数据
void* ptr1 = allocator.Allocate(128);
// 保存标记(用于回滚点)
void* marker = allocator.GetMarker();
// 分配临时数据
void* temp = allocator.Allocate(64);
void* temp2 = allocator.Allocate(32);
// 临时数据用完了,恢复到标记位置
allocator.SetMarker(marker);
// 此时 temp 和 temp2 的内存已被回收
// ptr1 仍然有效
```
## 相关文档
- [LinearAllocator 总览](linear-allocator.md) - 返回类总览