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

Method Allocate

be/src/runtime/bufferpool/system-allocator.cc:55–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55Status SystemAllocator::Allocate(int64_t len, BufferPool::BufferHandle* buffer) {
56 DCHECK_GE(len, min_buffer_len_);
57 DCHECK_LE(len, BufferPool::MAX_BUFFER_BYTES);
58 DCHECK(BitUtil::IsPowerOf2(len)) << len;
59
60 uint8_t* buffer_mem;
61 if (FLAGS_mmap_buffers) {
62 RETURN_IF_ERROR(AllocateViaMMap(len, &buffer_mem));
63 } else {
64 RETURN_IF_ERROR(AllocateViaMalloc(len, &buffer_mem));
65 }
66 buffer->Open(buffer_mem, len, CpuInfo::GetCurrentCore());
67 return Status::OK();
68}
69
70Status SystemAllocator::AllocateViaMMap(int64_t len, uint8_t** buffer_mem) {
71 int64_t map_len = len;

Callers

nothing calls this directly

Calls 2

OKFunction · 0.85
OpenMethod · 0.45

Tested by

no test coverage detected