[Insight-developers] patch to reduce memory leaks in itkKdTree

Simon Warfield simon.warfield at childrens.harvard.edu
Thu Feb 4 20:03:31 EST 2010


Luis Ibanez wrote:
> Hi Simon,
>
> Thanks for contributing this patch.
>
> I'm having problems compiling it with the ITK Test suite.
>
> It seems the statements that were added:
>
>  	  this->m_PartitionValue.Clear();
>  	  this->m_WeightedCentroid.Clear();
>  	  this->m_Centroid.Clear();
>  	  this->m_InstanceIdentifier.Clear();
>
> make sense only when the MeasurementType
> implements a "Clear()" method, which is something
> that can't be assumed for types such as
>
>    itk::Array
>    itk::FixedArray
>    std::vector
>
> We are therefore holding on this part of the
> patch.
>
> The other two parts of it have been committed.
>
>   
Thanks.
> Could you please let us know in what scenario
> (what specific template instantiation) did you find
> the calls to "Clear()" to be necessary   ?
>
>   
We will investigate and get back to you.
--Simon
>
>      Thanks
>
>
>            Luis
>
>
>
> ------------------------------------------------------
> On Mon, Feb 1, 2010 at 2:28 PM, Simon Warfield
> <simon.warfield at childrens.harvard.edu> wrote:
>   
>> Dear Luis,
>>
>>  Xavier has created this patch which reduces memory leaks when using an
>> itkKdTree.
>>  I would appreciate it if you could apply it to the code base.
>>
>>  On a design issue, on line 393 of itkKdTree.h the distance metric used by
>> the KdTree is hardcoded.
>>  I suggest to modify the distance metric to be a template parameter, with a
>> default equal to the current hard coded metric.
>>  This would allow for a KdTree to be used with alternative distance metrics
>> without having to copy the code and change the hard coded line.
>>
>> Luis Ibanez wrote:
>>     
>>> About the KdTree Memory Leaks and
>>> the release schedule.
>>>
>>> We have not defined a  hard date for
>>> the release. So, committing the bug
>>> fix now will work great.
>>>
>>> We could aim to release ITK 3.18 by
>>> the second week of February
>>> (for example).
>>>
>>>
>>> Would that be a convenient date ?
>>>
>>>
>>>     Thanks
>>>
>>>
>>>           Luis
>>>
>>>       
>> --
>> Simon
>>
>>     


-- 
Simon 



More information about the Insight-developers mailing list