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 2022/04/01 21:15:47 UTC

[GitHub] [tvm] tqchen commented on a change in pull request #10874: [BugFix] Fix PopenWorker Memory Leak

tqchen commented on a change in pull request #10874:
URL: https://github.com/apache/tvm/pull/10874#discussion_r840923808



##########
File path: python/tvm/exec/popen_worker.py
##########
@@ -40,22 +40,34 @@ def main():
     if len(sys.argv) != 3:
         print("Usage: <read_fd> <write_fd>")
         return
-    if sys.platform == "win32":
-        # pylint: disable=import-outside-toplevel
-        import msvcrt
-
-        reader = os.fdopen(msvcrt.open_osfhandle(int(sys.argv[1]), os.O_BINARY), "rb")
-        writer = os.fdopen(msvcrt.open_osfhandle(int(sys.argv[2]), os.O_BINARY), "wb")
-    else:
-        reader = os.fdopen(int(sys.argv[1]), "rb")
-        writer = os.fdopen(int(sys.argv[2]), "wb")
 
     logging.basicConfig(level=logging.INFO)
 
     lock = threading.Lock()
 
+    def get_reader():

Review comment:
       sorry that I actually do not fully get why fdopen in a subfunction helps. can you elaborate why? (with an example)




-- 
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: commits-unsubscribe@tvm.apache.org

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