| 972 | } |
| 973 | |
| 974 | static std::unique_ptr<PoolBuffer> MakeUnique(MemoryPool* pool, int64_t alignment) { |
| 975 | std::shared_ptr<MemoryManager> mm; |
| 976 | if (pool == nullptr) { |
| 977 | pool = default_memory_pool(); |
| 978 | mm = default_cpu_memory_manager(); |
| 979 | } else { |
| 980 | mm = CPUDevice::memory_manager(pool); |
| 981 | } |
| 982 | return std::make_unique<PoolBuffer>(std::move(mm), pool, alignment); |
| 983 | } |
| 984 | |
| 985 | private: |
| 986 | static Result<int64_t> RoundCapacity(int64_t capacity) { |
nothing calls this directly
no test coverage detected