You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/04/03 20:11:55 UTC

[GitHub] cjolivier01 commented on a change in pull request #9400: Fixed memory leak

cjolivier01 commented on a change in pull request #9400: Fixed memory leak
URL: https://github.com/apache/incubator-mxnet/pull/9400#discussion_r178947357
 
 

 ##########
 File path: src/operator/operator_tune-inl.h
 ##########
 @@ -616,7 +616,7 @@ class UnaryOpTune : public OperatorTune<DType> {
    */
   template<typename OP>
   static duration_t GetBlankWorkloadEx() {
-    std::unique_ptr<DType> tmp(new DType[Super::WORKLOAD_COUNT]);
+    std::unique_ptr<DType[]> tmp(new DType[Super::WORKLOAD_COUNT]);
 
 Review comment:
   I am not sure what you're getting at, @larroy. While valgrind may report a mismatch, it is very unlikely that memory is actually being leaked, which is my point.  Every implementation that I know of evetually just call the same C malloc and free() call for delete and deete[].
   For example: https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/libsupc%2B%2B/del_opv.cc?view=markup
   So it's fine to change it as a matter of consistency, but saying that it is leaking memory is probably not true.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services