| 78 | } |
| 79 | |
| 80 | Allocator* cpu_allocator(int numa_node) { |
| 81 | // Correctness relies on devices being created prior to the first call |
| 82 | // to cpu_allocator, if devices are ever to be created in the process. |
| 83 | // Device creation in turn triggers ProcessState creation and the availability |
| 84 | // of the correct access pointer via this function call. |
| 85 | static ProcessStateInterface* ps = |
| 86 | AllocatorFactoryRegistry::singleton()->process_state(); |
| 87 | if (ps) { |
| 88 | return ps->GetCPUAllocator(numa_node); |
| 89 | } else { |
| 90 | return cpu_allocator_base(); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | Allocator* pmem_allocator() { |
| 95 | static Allocator* pmem_alloc = |