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

Method AllocateAligned

cpp/src/arrow/memory_pool.cc:398–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396class MimallocAllocator {
397 public:
398 static Status AllocateAligned(int64_t size, int64_t alignment, uint8_t** out) {
399 if (size == 0) {
400 *out = memory_pool::internal::kZeroSizeArea;
401 return Status::OK();
402 }
403 *out = reinterpret_cast<uint8_t*>(
404 mi_malloc_aligned(static_cast<size_t>(size), static_cast<size_t>(alignment)));
405 if (*out == NULL) {
406 return Status::OutOfMemory("malloc of size ", size, " failed");
407 }
408 return Status::OK();
409 }
410
411 static void ReleaseUnused() { mi_collect(true); }
412

Callers

nothing calls this directly

Calls 2

OutOfMemoryFunction · 0.85
OKFunction · 0.70

Tested by

no test coverage detected