| 577 | #endif |
| 578 | |
| 579 | std::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 | |
| 601 | static struct GlobalState { |
| 602 | ~GlobalState() { finalizing_.store(true, std::memory_order_relaxed); } |
nothing calls this directly
no test coverage detected