Skip to content

Commit

Permalink
[RUNTIME] rename allocator.make -> allocator.make_object for term con…
Browse files Browse the repository at this point in the history
…sistency (#4416)
  • Loading branch information
tqchen authored and yzhliu committed Nov 24, 2019
1 parent 34c636d commit fbb2a35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/tvm/runtime/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/vm/vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit fbb2a35

Please sign in to comment.