| 65 | } |
| 66 | |
| 67 | Allocator* cpu_allocator_base() { |
| 68 | static Allocator* cpu_alloc = |
| 69 | AllocatorFactoryRegistry::singleton()->GetAllocator(); |
| 70 | // TODO(tucker): This really seems wrong. It's only going to be effective on |
| 71 | // the first call in a process (but the desired effect is associated with a |
| 72 | // session), and we probably ought to be tracking the highest level Allocator, |
| 73 | // not the lowest. Revisit the advertised semantics of the triggering option. |
| 74 | if (cpu_allocator_collect_full_stats && !cpu_alloc->TracksAllocationSizes()) { |
| 75 | cpu_alloc = new TrackingAllocator(cpu_alloc, true); |
| 76 | } |
| 77 | return cpu_alloc; |
| 78 | } |
| 79 | |
| 80 | Allocator* cpu_allocator(int numa_node) { |
| 81 | // Correctness relies on devices being created prior to the first call |