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

Method CreateDefault

cpp/src/arrow/memory_pool.cc:574–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572#endif
573
574std::unique_ptr<MemoryPool> MemoryPool::CreateDefault() {
575 auto backend = DefaultBackend();
576 switch (backend) {
577 case MemoryPoolBackend::System:
578 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new SystemDebugMemoryPool)
579 : std::unique_ptr<MemoryPool>(new SystemMemoryPool);
580#ifdef ARROW_JEMALLOC
581 case MemoryPoolBackend::Jemalloc:
582 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new JemallocDebugMemoryPool)
583 : std::unique_ptr<MemoryPool>(new JemallocMemoryPool);
584#endif
585#ifdef ARROW_MIMALLOC
586 case MemoryPoolBackend::Mimalloc:
587 return IsDebugEnabled() ? std::unique_ptr<MemoryPool>(new MimallocDebugMemoryPool)
588 : std::unique_ptr<MemoryPool>(new MimallocMemoryPool);
589#endif
590 default:
591 ARROW_LOG(FATAL) << "Internal error: cannot create default memory pool";
592 return nullptr;
593 }
594}
595
596static struct GlobalState {
597 ~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