MCPcopy Create free account
hub / github.com/apache/impala / AllocateUnreservedBuffer

Method AllocateUnreservedBuffer

be/src/runtime/bufferpool/buffer-pool.cc:243–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243Status BufferPool::AllocateUnreservedBuffer(
244 ClientHandle* client, int64_t len, BufferHandle* handle) {
245 DCHECK(!handle->is_open());
246 bool success;
247 RETURN_IF_ERROR(client->impl_->PrepareToAllocateBuffer(len, false, &success));
248 if (!success) return Status::OK(); // Leave 'handle' closed to indicate failure.
249
250 Status status = allocator_->Allocate(client, len, handle);
251 // If the allocation failed, update client's accounting to reflect the failure.
252 if (!status.ok()) client->impl_->FreedBuffer(len);
253 return status;
254}
255
256void BufferPool::FreeBuffer(ClientHandle* client, BufferHandle* handle) {
257 if (!handle->is_open()) return; // Should be idempotent.

Callers 2

AllocateBufferMethod · 0.80
TestBufferAllocationMethod · 0.80

Calls 6

OKFunction · 0.85
FreedBufferMethod · 0.80
is_openMethod · 0.45
AllocateMethod · 0.45
okMethod · 0.45

Tested by 1

TestBufferAllocationMethod · 0.64