| 467 | } |
| 468 | |
| 469 | void BufferPool::BufferAllocator::ReleaseMemory(int64_t bytes_to_free) { |
| 470 | int64_t bytes_freed = 0; |
| 471 | int current_core = CpuInfo::GetCurrentCore(); |
| 472 | for (int i = 0; i < per_core_arenas_.size(); ++i) { |
| 473 | int core_to_check = (current_core + i) % per_core_arenas_.size(); |
| 474 | FreeBufferArena* arena = per_core_arenas_[core_to_check].get(); |
| 475 | // Free but don't claim any memory. |
| 476 | bytes_freed += arena->FreeSystemMemory(bytes_to_free - bytes_freed, 0, nullptr).first; |
| 477 | if (bytes_freed >= bytes_to_free) break; |
| 478 | } |
| 479 | VLOG(1) << "BufferAllocator::ReleaseMemory(): Freed " |
| 480 | << PrettyPrinter::PrintBytes(bytes_freed); |
| 481 | } |
| 482 | |
| 483 | int BufferPool::BufferAllocator::GetFreeListSize(int core, int64_t len) { |
| 484 | return per_core_arenas_[core]->GetFreeListSize(len); |
nothing calls this directly
no test coverage detected