# PoolAllocator::GetTotalFreed ```cpp size_t GetTotalFreed() const override; ``` 返回当前空闲的内存总量(字节)。计算公式:`m_freeBlocks * m_blockSize`。 **参数:** 无 **返回:** 当前空闲块的字节数 **复杂度:** O(1) **示例:** ```cpp #include PoolAllocator pool(sizeof(int), 100); size_t freed = pool.GetTotalFreed(); // 100 * sizeof(int) void* block = pool.Allocate(); freed = pool.GetTotalFreed(); // 99 * sizeof(int) pool.Free(block); freed = pool.GetTotalFreed(); // 100 * sizeof(int) ``` ## 相关文档 - [PoolAllocator 总览](pool-allocator.md) - 返回类总览