| 232 | } |
| 233 | |
| 234 | Status BufferPool::AllocateBuffer( |
| 235 | ClientHandle* client, int64_t len, BufferHandle* handle) { |
| 236 | RETURN_IF_ERROR(client->impl_->PrepareToAllocateBuffer(len, true, nullptr)); |
| 237 | Status status = allocator_->Allocate(client, len, handle); |
| 238 | // If the allocation failed, update client's accounting to reflect the failure. |
| 239 | if (!status.ok()) client->impl_->FreedBuffer(len); |
| 240 | return status; |
| 241 | } |
| 242 | |
| 243 | Status BufferPool::AllocateUnreservedBuffer( |
| 244 | ClientHandle* client, int64_t len, BufferHandle* handle) { |