masahi commented on code in PR #16750:
URL: https://github.com/apache/tvm/pull/16750#discussion_r1571443663


##########
include/tvm/runtime/memory/memory_manager.h:
##########
@@ -157,7 +160,7 @@ class StorageObj : public Object {
 /*! \brief reference to storage. */
 class Storage : public ObjectRef {
  public:
-  TVM_DLL explicit Storage(Buffer buffer);
+  TVM_DLL explicit Storage(Buffer buffer, Allocator* allocator);

Review Comment:
   What worries me is that the code is doing `allocator->Free(buffer);` in the 
destructor. But how can you be sure that it's safe if there is no guarantee 
that the allocator is always attached to the storage when it is created?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to