[RUNTIME] rename allocator.make -> allocator.make_object for term consistency (#4416)
authorTianqi Chen <tqchen@users.noreply.github.com>
Sun, 24 Nov 2019 22:34:17 +0000 (14:34 -0800)
committerYizhi Liu <liuyizhi@apache.org>
Sun, 24 Nov 2019 22:34:17 +0000 (14:34 -0800)
include/tvm/runtime/memory.h
src/runtime/vm/vm.cc

index d28552e..07e22d7 100644 (file)
@@ -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
index cc16391..333dd1e 100644 (file)
@@ -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";