docs: update memory and threading API docs
This commit is contained in:
30
docs/api/memory/linear-allocator/get-total-freed.md
Normal file
30
docs/api/memory/linear-allocator/get-total-freed.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# LinearAllocator::GetTotalFreed
|
||||
|
||||
```cpp
|
||||
size_t GetTotalFreed() const override;
|
||||
```
|
||||
|
||||
返回自分配器创建以来的累计释放字节数。线性分配器不支持单个块释放,始终返回 0。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 始终返回 `0`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Memory/LinearAllocator.h>
|
||||
|
||||
LinearAllocator allocator(1024);
|
||||
|
||||
void* ptr = allocator.Allocate(256);
|
||||
allocator.Free(ptr); // 无实际效果
|
||||
|
||||
size_t freed = allocator.GetTotalFreed(); // 0
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [LinearAllocator 总览](linear-allocator.md) - 返回类总览
|
||||
Reference in New Issue
Block a user