提交 94b58a29 编写于 作者: L liaogang

Follow comments

上级 d8560ec2
...@@ -30,8 +30,7 @@ std::once_flag cpu_allocator_flag; ...@@ -30,8 +30,7 @@ std::once_flag cpu_allocator_flag;
std::once_flag gpu_allocator_flag; std::once_flag gpu_allocator_flag;
BuddyAllocator* GetCPUBuddyAllocator() { BuddyAllocator* GetCPUBuddyAllocator() {
static std::unique_ptr<BuddyAllocator, void (*)(BuddyAllocator*)> a{ static std::unique_ptr<BuddyAllocator> a{nullptr};
nullptr, [](BuddyAllocator* p) { delete p; }};
std::call_once(cpu_allocator_flag, [&]() { std::call_once(cpu_allocator_flag, [&]() {
a.reset(new BuddyAllocator(new detail::CPUAllocator, a.reset(new BuddyAllocator(new detail::CPUAllocator,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册