Adds a free buffer to the list.
| 68 | |
| 69 | /// Adds a free buffer to the list. |
| 70 | void AddFreeBuffer(BufferHandle&& buffer) { |
| 71 | buffer.Poison(); |
| 72 | free_list_.emplace_back(std::move(buffer)); |
| 73 | std::push_heap(free_list_.begin(), free_list_.end(), HeapCompare); |
| 74 | } |
| 75 | |
| 76 | /// Get the 'num_buffers' buffers with the highest memory address from the list to |
| 77 | /// free. The average time complexity is n log n, where n is the current size of the |