- 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
866 B
866 B
LinearAllocator::GetUsedSize
size_t GetUsedSize() const;
返回当前已使用的字节数,即内部偏移量的值。此值在 Allocate 后增加,在 Clear 或 SetMarker 后可能减少(取决于设置的目标位置)。
参数: 无
返回: 已使用的字节数
复杂度: O(1)
示例:
#include <XCEngine/Memory/LinearAllocator.h>
LinearAllocator allocator(1024);
size_t before = allocator.GetUsedSize(); // 0
allocator.Allocate(128);
allocator.Allocate(256);
size_t after = allocator.GetUsedSize(); // 384
void* marker = allocator.GetMarker();
allocator.Allocate(64);
size_t with_temp = allocator.GetUsedSize(); // 448
allocator.SetMarker(marker);
size_t after_rollback = allocator.GetUsedSize(); // 384
相关文档
- LinearAllocator 总览 - 返回类总览