MCPcopy Create free account
hub / github.com/apache/arrow / AllocateAligned

Method AllocateAligned

cpp/src/arrow/memory_pool_jemalloc.cc:85–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83namespace internal {
84
85Status JemallocAllocator::AllocateAligned(int64_t size, int64_t alignment,
86 uint8_t** out) {
87 if (size == 0) {
88 *out = kZeroSizeArea;
89 return Status::OK();
90 }
91 *out = reinterpret_cast<uint8_t*>(
92 mallocx(static_cast<size_t>(size), MALLOCX_ALIGN(static_cast<size_t>(alignment))));
93 if (*out == NULL) {
94 return Status::OutOfMemory("malloc of size ", size, " failed");
95 }
96 return Status::OK();
97}
98
99Status JemallocAllocator::ReallocateAligned(int64_t old_size, int64_t new_size,
100 int64_t alignment, uint8_t** ptr) {

Callers

nothing calls this directly

Calls 2

OutOfMemoryFunction · 0.85
OKFunction · 0.70

Tested by

no test coverage detected