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:
31
docs/api/memory/pool-allocator/get-block-size.md
Normal file
31
docs/api/memory/pool-allocator/get-block-size.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# PoolAllocator::GetBlockSize
|
||||
|
||||
```cpp
|
||||
size_t GetBlockSize() const;
|
||||
```
|
||||
|
||||
返回内存池中每个内存块的大小。此值在构造时确定,之后保持不变。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 每个内存块的字节大小
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/PoolAllocator.h>
|
||||
|
||||
PoolAllocator pool(sizeof(int) * 100, 50);
|
||||
|
||||
size_t blockSize = pool.GetBlockSize(); // 400 字节
|
||||
|
||||
void* block = pool.Allocate();
|
||||
int* arr = static_cast<int*>(block);
|
||||
// arr 指向的大小为 blockSize 字节的内存块
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [PoolAllocator 总览](pool-allocator.md) - 返回类总览
|
||||
Reference in New Issue
Block a user