trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prashanth-vasudev <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #815: [TRAFODION-2326] TopN sort reuse of r...
Date Fri, 04 Nov 2016 07:25:33 GMT
Github user prashanth-vasudev commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/815#discussion_r86497791
  
    --- Diff: core/sql/executor/ex_sort.cpp ---
    @@ -330,21 +364,39 @@ ExSortTcb::~ExSortTcb()
        nfDiags_ = NULL;
       
       freeResources();
    -  
    -  if(pool_)
    -    delete pool_;
    +
     };
       
     ////////////////////////////////////////////////////////////////////////
     // Free Resources
     //
     void ExSortTcb::freeResources()
     {
    -  if (sortPool_)
    +  if (partialSortPool_)
    +  {
    +    delete partialSortPool_;
    +    partialSortPool_ = NULL;
    +  }
    +  if (regularSortPool_)
    +  {
    +    delete regularSortPool_;
    +    regularSortPool_ = NULL;
    +  }
    +  if (topNSortPool_)
    +  {
    +    delete topNSortPool_;
    +    topNSortPool_ = NULL;
    +  }
    +  if (sortPool_ && (sortPool_ != receivePool_))
    --- End diff --
    
    I will make this change. The thinking was to delete the memory once, either by sortPool_
or receivePool_.  setting them to null seems to be a no op since it is called only in the
destructor.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message