You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/06/03 19:11:40 UTC

[GitHub] [tvm] elvin-n commented on a change in pull request #8175: [METAL] Fix the rest memory leaks in Metal runtime

elvin-n commented on a change in pull request #8175:
URL: https://github.com/apache/tvm/pull/8175#discussion_r645060222



##########
File path: src/runtime/metal/metal_common.h
##########
@@ -42,9 +42,37 @@
 
 #include "../workspace_pool.h"
 
+#define AUTORELEASEPOOL tvm::runtime::metal::AutoReleasePoolWrapper::GetInstance() << [&]()
+
 namespace tvm {
 namespace runtime {
 namespace metal {
+class AutoReleasePoolWrapper {
+ public:
+  static AutoReleasePoolWrapper& GetInstance() {

Review comment:
       Not sure if this construction safe been used from several libraries. Even if we do not have several modules, it's better to move body of the function into cpp file




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org