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

Method CreateDefault

cpp/src/arrow/memory_pool.cc:579–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577#endif
578
579std::unique_ptr<MemoryPool> MemoryPool::CreateDefault() {
580 auto backend = DefaultBackend();
581 switch (backend) {
582 case MemoryPoolBackend::System:
583 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new SystemDebugMemoryPool)
584 : std::unique_ptr<MemoryPool>(new SystemMemoryPool);
585#ifdef ARROW_JEMALLOC
586 case MemoryPoolBackend::Jemalloc:
587 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new JemallocDebugMemoryPool)
588 : std::unique_ptr<MemoryPool>(new JemallocMemoryPool);
589#endif
590#ifdef ARROW_MIMALLOC
591 case MemoryPoolBackend::Mimalloc:
592 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new MimallocDebugMemoryPool)
593 : std::unique_ptr<MemoryPool>(new MimallocMemoryPool);
594#endif
595 default:
596 ARROW_LOG(FATAL) << "Internal error: cannot create default memory pool";
597 return nullptr;
598 }
599}
600
601static struct GlobalState {
602 ~GlobalState() { finalizing_.store(true, std::memory_order_relaxed); }

Callers

nothing calls this directly

Calls 2

DefaultBackendFunction · 0.85
IsDebugEnabledFunction · 0.85

Tested by

no test coverage detected