Commit fbb2a356 by Tianqi Chen Committed by Yizhi Liu

[RUNTIME] rename allocator.make -> allocator.make_object for term consistency (#4416)

parent 34c636d9
......@@ -58,12 +58,13 @@ template<typename Derived>
class ObjAllocatorBase {
public:
/*!
* \brief Make a new object using the allocator.
* \tparam T The type to be allocated.
* \tparam Args The constructor signature.
* \param args The arguments.
*/
template<typename T, typename... Args>
inline ObjectPtr<T> make(Args&&... args) {
inline ObjectPtr<T> make_object(Args&&... args) {
using Handler = typename Derived::template Handler<T>;
static_assert(std::is_base_of<Object, T>::value,
"make_node can only be used to create NodeBase");
......@@ -126,7 +127,7 @@ class SimpleObjAllocator :
template<typename T, typename... Args>
inline ObjectPtr<T> make_object(Args&&... args) {
return SimpleObjAllocator().make<T>(std::forward<Args>(args)...);
return SimpleObjAllocator().make_object<T>(std::forward<Args>(args)...);
}
} // namespace runtime
......
......@@ -47,7 +47,7 @@ namespace vm {
inline Storage make_storage(size_t size, size_t alignment, TVMType dtype_hint, TVMContext ctx) {
// We could put cache in here, from ctx to storage allocator.
auto storage_obj = SimpleObjAllocator().make<StorageObj>();
auto storage_obj = SimpleObjAllocator().make_object<StorageObj>();
auto alloc = MemoryManager::Global()->GetAllocator(ctx);
DCHECK(alloc != nullptr)
<< "allocator must not null";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment