| 667 | } |
| 668 | |
| 669 | MemoryPool* default_memory_pool() { |
| 670 | auto backend = DefaultBackend(); |
| 671 | switch (backend) { |
| 672 | case MemoryPoolBackend::System: |
| 673 | return global_state.system_memory_pool(); |
| 674 | #ifdef ARROW_JEMALLOC |
| 675 | case MemoryPoolBackend::Jemalloc: |
| 676 | return global_state.jemalloc_memory_pool(); |
| 677 | #endif |
| 678 | #ifdef ARROW_MIMALLOC |
| 679 | case MemoryPoolBackend::Mimalloc: |
| 680 | return global_state.mimalloc_memory_pool(); |
| 681 | #endif |
| 682 | default: |
| 683 | ARROW_LOG(FATAL) << "Internal error: cannot create default memory pool"; |
| 684 | return nullptr; |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | #ifndef ARROW_JEMALLOC |
| 689 | Status jemalloc_set_decay_ms(int ms) { |